fork(2) download
  1. void parseString(){
  2. if (strncmp(parseptr, "$GPGGA",6) == 0)
  3. parseGPGGA();
  4. if (strncmp(parseptr, "$GPGSA",6) == 0)
  5. parseGPGSA();
  6. if (strncmp(parseptr, "$GPRMC",6) == 0 )
  7. parseGPRMC();
  8. if (strncmp(parseptr, "$GPVTG",6) == 0 )
  9. parseGPVTG();
  10. if (strncmp(parseptr, "$HCHDG",6) == 0)
  11. parseHCHDG();
  12. if (strncmp(parseptr, "$WIMDA",6) == 0 )
  13. parseWIMDA();
  14. if (strncmp(parseptr, "$PFEC,GPatt",11) == 0 )
  15. parsePFEC();
  16. if (strncmp(parseptr, "$WIXDR",6) == 0 )
  17. parseWIXDR();
  18. if (strncmp(parseptr, "$RDATA",6) == 0 )
  19. parseRDATA();
  20.  
  21. }
  22. void parseGPGGA(){
  23. parseptr = parseptr+7;
  24. float inFloat;
  25. for (int i = 1; i<10;i++){
  26. if (parseptr[0] != ',') {
  27. switch (i){
  28. case 1:
  29. inFloat= atof(parseptr);
  30. timeHHMMSS = (uint32_t)inFloat;
  31. break;
  32. case 2:
  33. lattitude = atof(parseptr);
  34. break;
  35. case 4:
  36. longitude = atof(parseptr);
  37. case 6:
  38. fixQuality = atoi(parseptr);
  39. if(fixQuality == 0)
  40. gpsFix = false;
  41. else
  42. gpsFix = true;
  43. case 9:
  44. alt = atof(parseptr);
  45. default:
  46. break;
  47. }
  48. parseptr = strchr(parseptr, ',') + 1;
  49. }
  50. else
  51. parseptr = parseptr +1;
  52. }
  53. }
  54. void parseGPGSA(){
  55. parseptr = parseptr+7;
  56. if (parseptr[9] == 3)
  57. gpsFix = true;
  58. else
  59. gpsFix = false;
  60. }
  61. void parseGPRMC(){
  62. parseptr = parseptr+7;
  63. float inFloat;
  64. for (int i = 1; i<9;i++){
  65. if (parseptr[0] != ',') {
  66. switch (i){
  67. case 1:
  68. inFloat= atof(parseptr);
  69. timeHHMMSS = (uint32_t)inFloat;
  70. break;
  71. case 3:
  72. lattitude = atof(parseptr);
  73. break;
  74. case 5:
  75. longitude = atof(parseptr);
  76. break;
  77. case 7:
  78. speedKnots = atof(parseptr);
  79. break;
  80. case 8:
  81. trueHeading = atof(parseptr);
  82. break;
  83. default:
  84. break;
  85. }
  86. parseptr = strchr(parseptr, ',') + 1;
  87. }
  88. else
  89. parseptr = parseptr +1;
  90. }
  91. }
  92.  
  93. void parseGPVTG(){
  94. parseptr = parseptr+7;
  95. for (int i = 1; i<8;i++){
  96. if (parseptr[0] != ',') {
  97. switch (i){
  98. case 1:
  99. trueHeading = atof(parseptr);
  100. break;
  101. case 3:
  102. magneticHeading = atof(parseptr);
  103. break;
  104. case 5:
  105. speedKnots = atof(parseptr);
  106. break;
  107. case 7:
  108. speedKMH = atof(parseptr);
  109. break;
  110. default:
  111. break;
  112. }
  113. parseptr = strchr(parseptr, ',') + 1;
  114. }
  115. else
  116. parseptr = parseptr +1;
  117.  
  118. }
  119. }
  120.  
  121.  
  122. void parseHCHDG(){
  123. parseptr = parseptr+7;
  124. for (int i = 1; i<8;i++){
  125. if (parseptr[0] != ',') {
  126. switch (i){
  127. case 1:
  128. trueHeading = atof(parseptr);
  129. break;
  130. case 3:
  131. magneticHeading = atof(parseptr);
  132. break;
  133. case 5:
  134. speedKnots = atof(parseptr);
  135. break;
  136. case 7:
  137. speedKMH = atof(parseptr);
  138. break;
  139. default:
  140. break;
  141. }
  142. parseptr = strchr(parseptr, ',') + 1;
  143. }
  144. else {
  145. parseptr = parseptr +1;
  146. }
  147. }
  148. }
  149.  
  150. void parsePFEC(){
  151. parseptr = parseptr+12;
  152. for (int i = 1; i<4;i++){
  153. if (parseptr[0] != ',') {
  154. switch (i){
  155. case 1:
  156. weatherPitch = atof(parseptr);
  157. break;
  158. case 2:
  159. weatherRoll = atof(parseptr);
  160. break;
  161. case 3:
  162. weatherYaw = atof(parseptr);
  163. break;
  164. default:
  165. break;
  166. }
  167. parseptr = strchr(parseptr, ',') + 1;
  168. }
  169. else
  170. parseptr = parseptr +1;
  171. }
  172. }
  173. void parseWIMDA(){
  174. parseptr = parseptr+7;
  175. for (int i = 1; i<20;i++){
  176. if (parseptr[0] != ',') {
  177. switch (i){
  178. case 1:
  179. barometricPressureInches = atof(parseptr);
  180. break;
  181. case 3:
  182. barometricPressureBars= atof(parseptr);
  183. break;
  184. case 5:
  185. airTemp = atof(parseptr);
  186. break;
  187. case 9:
  188. relativeHumidity = atof(parseptr);
  189. break;
  190. case 11:
  191. dewPoint = atof(parseptr);
  192. break;
  193. case 13:
  194. windDirectionTrue = atof(parseptr);
  195. break;
  196. case 15:
  197. windDirectionMagnetic = atof(parseptr);
  198. break;
  199. case 17:
  200. windSpeedKnots = atof(parseptr);
  201. break;
  202. case 19:
  203. windSpeedMetersPerSecond = atof(parseptr);
  204. break;
  205. default:
  206. break;
  207. }
  208. parseptr = strchr(parseptr, ',') + 1;
  209. }
  210. else
  211. parseptr = parseptr +1;
  212. }
  213. }
  214. void parseWIXDR(){
  215. parseptr = parseptr+7;
  216. for (int i = 1; i<15;i++){
  217. if (parseptr[0] != ',') {
  218. switch (i){
  219. case 2:
  220. relativeWindChill = atof(parseptr);
  221. break;
  222. case 6:
  223. theoreticalWindChill = atof(parseptr);
  224. break;
  225. case 10:
  226. weatherPitch = atof(parseptr);
  227. break;
  228. case 14:
  229. weatherRoll = atof(parseptr);
  230. break;
  231. default:
  232. break;
  233. }
  234. parseptr = strchr(parseptr, ',') + 1;
  235. }
  236. else
  237. parseptr = parseptr +1;
  238. }
  239. }
  240.  
  241. void parseRDATA(){
  242. parseptr = parseptr+7;
  243. for (int i = 1; i<4;i++){
  244. if (parseptr[0] != ',') {
  245. switch (i){
  246. case 1:
  247. countPerMinute = atoi(parseptr);
  248. break;
  249. case 3:
  250. microSievertPerHour = atof(parseptr);
  251. break;
  252. default:
  253. break;
  254. }
  255. parseptr = strchr(parseptr, ',') + 1;
  256. }
  257. else {
  258. parseptr = parseptr +1;
  259. }
  260. }
  261. }
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268.  
  269.  
  270.  
  271.  
  272.  
  273.  
  274.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp: In function ‘void parseString()’:
prog.cpp:2: error: ‘parseptr’ was not declared in this scope
prog.cpp:2: error: ‘strncmp’ was not declared in this scope
prog.cpp:3: error: ‘parseGPGGA’ was not declared in this scope
prog.cpp:4: error: ‘parseptr’ was not declared in this scope
prog.cpp:4: error: ‘strncmp’ was not declared in this scope
prog.cpp:5: error: ‘parseGPGSA’ was not declared in this scope
prog.cpp:6: error: ‘parseptr’ was not declared in this scope
prog.cpp:6: error: ‘strncmp’ was not declared in this scope
prog.cpp:7: error: ‘parseGPRMC’ was not declared in this scope
prog.cpp:8: error: ‘parseptr’ was not declared in this scope
prog.cpp:8: error: ‘strncmp’ was not declared in this scope
prog.cpp:9: error: ‘parseGPVTG’ was not declared in this scope
prog.cpp:10: error: ‘parseptr’ was not declared in this scope
prog.cpp:10: error: ‘strncmp’ was not declared in this scope
prog.cpp:11: error: ‘parseHCHDG’ was not declared in this scope
prog.cpp:12: error: ‘parseptr’ was not declared in this scope
prog.cpp:12: error: ‘strncmp’ was not declared in this scope
prog.cpp:13: error: ‘parseWIMDA’ was not declared in this scope
prog.cpp:14: error: ‘parseptr’ was not declared in this scope
prog.cpp:14: error: ‘strncmp’ was not declared in this scope
prog.cpp:15: error: ‘parsePFEC’ was not declared in this scope
prog.cpp:16: error: ‘parseptr’ was not declared in this scope
prog.cpp:16: error: ‘strncmp’ was not declared in this scope
prog.cpp:17: error: ‘parseWIXDR’ was not declared in this scope
prog.cpp:18: error: ‘parseptr’ was not declared in this scope
prog.cpp:18: error: ‘strncmp’ was not declared in this scope
prog.cpp:19: error: ‘parseRDATA’ was not declared in this scope
prog.cpp: In function ‘void parseGPGGA()’:
prog.cpp:23: error: ‘parseptr’ was not declared in this scope
prog.cpp:29: error: ‘atof’ was not declared in this scope
prog.cpp:30: error: ‘timeHHMMSS’ was not declared in this scope
prog.cpp:30: error: ‘uint32_t’ was not declared in this scope
prog.cpp:30: error: expected `;' before ‘inFloat’
prog.cpp:33: error: ‘lattitude’ was not declared in this scope
prog.cpp:36: error: ‘longitude’ was not declared in this scope
prog.cpp:38: error: ‘fixQuality’ was not declared in this scope
prog.cpp:38: error: ‘atoi’ was not declared in this scope
prog.cpp:40: error: ‘gpsFix’ was not declared in this scope
prog.cpp:42: error: ‘gpsFix’ was not declared in this scope
prog.cpp:44: error: ‘alt’ was not declared in this scope
prog.cpp:48: error: ‘strchr’ was not declared in this scope
prog.cpp: In function ‘void parseGPGSA()’:
prog.cpp:55: error: ‘parseptr’ was not declared in this scope
prog.cpp:57: error: ‘gpsFix’ was not declared in this scope
prog.cpp:59: error: ‘gpsFix’ was not declared in this scope
prog.cpp: In function ‘void parseGPRMC()’:
prog.cpp:62: error: ‘parseptr’ was not declared in this scope
prog.cpp:68: error: ‘atof’ was not declared in this scope
prog.cpp:69: error: ‘timeHHMMSS’ was not declared in this scope
prog.cpp:69: error: ‘uint32_t’ was not declared in this scope
prog.cpp:69: error: expected `;' before ‘inFloat’
prog.cpp:72: error: ‘lattitude’ was not declared in this scope
prog.cpp:75: error: ‘longitude’ was not declared in this scope
prog.cpp:78: error: ‘speedKnots’ was not declared in this scope
prog.cpp:81: error: ‘trueHeading’ was not declared in this scope
prog.cpp:86: error: ‘strchr’ was not declared in this scope
prog.cpp: In function ‘void parseGPVTG()’:
prog.cpp:94: error: ‘parseptr’ was not declared in this scope
prog.cpp:99: error: ‘trueHeading’ was not declared in this scope
prog.cpp:99: error: ‘atof’ was not declared in this scope
prog.cpp:102: error: ‘magneticHeading’ was not declared in this scope
prog.cpp:105: error: ‘speedKnots’ was not declared in this scope
prog.cpp:108: error: ‘speedKMH’ was not declared in this scope
prog.cpp:113: error: ‘strchr’ was not declared in this scope
prog.cpp: In function ‘void parseHCHDG()’:
prog.cpp:123: error: ‘parseptr’ was not declared in this scope
prog.cpp:128: error: ‘trueHeading’ was not declared in this scope
prog.cpp:128: error: ‘atof’ was not declared in this scope
prog.cpp:131: error: ‘magneticHeading’ was not declared in this scope
prog.cpp:134: error: ‘speedKnots’ was not declared in this scope
prog.cpp:137: error: ‘speedKMH’ was not declared in this scope
prog.cpp:142: error: ‘strchr’ was not declared in this scope
prog.cpp: In function ‘void parsePFEC()’:
prog.cpp:151: error: ‘parseptr’ was not declared in this scope
prog.cpp:156: error: ‘weatherPitch’ was not declared in this scope
prog.cpp:156: error: ‘atof’ was not declared in this scope
prog.cpp:159: error: ‘weatherRoll’ was not declared in this scope
prog.cpp:162: error: ‘weatherYaw’ was not declared in this scope
prog.cpp:167: error: ‘strchr’ was not declared in this scope
prog.cpp: In function ‘void parseWIMDA()’:
prog.cpp:174: error: ‘parseptr’ was not declared in this scope
prog.cpp:179: error: ‘barometricPressureInches’ was not declared in this scope
prog.cpp:179: error: ‘atof’ was not declared in this scope
prog.cpp:182: error: ‘barometricPressureBars’ was not declared in this scope
prog.cpp:185: error: ‘airTemp’ was not declared in this scope
prog.cpp:188: error: ‘relativeHumidity’ was not declared in this scope
prog.cpp:191: error: ‘dewPoint’ was not declared in this scope
prog.cpp:194: error: ‘windDirectionTrue’ was not declared in this scope
prog.cpp:197: error: ‘windDirectionMagnetic’ was not declared in this scope
prog.cpp:200: error: ‘windSpeedKnots’ was not declared in this scope
prog.cpp:203: error: ‘windSpeedMetersPerSecond’ was not declared in this scope
prog.cpp:208: error: ‘strchr’ was not declared in this scope
prog.cpp: In function ‘void parseWIXDR()’:
prog.cpp:215: error: ‘parseptr’ was not declared in this scope
prog.cpp:220: error: ‘relativeWindChill’ was not declared in this scope
prog.cpp:220: error: ‘atof’ was not declared in this scope
prog.cpp:223: error: ‘theoreticalWindChill’ was not declared in this scope
prog.cpp:226: error: ‘weatherPitch’ was not declared in this scope
prog.cpp:229: error: ‘weatherRoll’ was not declared in this scope
prog.cpp:234: error: ‘strchr’ was not declared in this scope
prog.cpp: In function ‘void parseRDATA()’:
prog.cpp:242: error: ‘parseptr’ was not declared in this scope
prog.cpp:247: error: ‘countPerMinute’ was not declared in this scope
prog.cpp:247: error: ‘atoi’ was not declared in this scope
prog.cpp:250: error: ‘microSievertPerHour’ was not declared in this scope
prog.cpp:250: error: ‘atof’ was not declared in this scope
prog.cpp:255: error: ‘strchr’ was not declared in this scope
stdout
Standard output is empty