Commit 232c771364521f1ddea8b219595993dbab1a1519
1 parent
62657921
--no commit message
Showing
1 changed file
with
4 additions
and
22 deletions
Project/applications/smartcities/main2.c
... | ... | @@ -85,7 +85,7 @@ void init_registry(void) |
85 | 85 | |
86 | 86 | } |
87 | 87 | |
88 | -void send_data() | |
88 | +void send_data(char** buffers[j], uint32_t ind[], uint32_t sizes[j], uint8_t sensors[]); | |
89 | 89 | { |
90 | 90 | int j; |
91 | 91 | for(j=0;j<TOTAL_SENSORS;j++) |
... | ... | @@ -190,30 +190,14 @@ int main(void) |
190 | 190 | printf("timestamp (absolute):\t%d\r\ntimestamp mod LONG_PERIOD:\t%d\r\ntimestamp mod SHORT_PERIOD:\t%d\r\n",timestamp,timestamp%LONG_PERIOD,timestamp%SHORT_PERIOD); |
191 | 191 | |
192 | 192 | /* Add data to the buffer with timestamp*/ |
193 | + | |
194 | + //a_cookedData = format_data(a_rawData, timestamp); | |
193 | 195 | put_buffers(buffers,ind,sizes,valueSensors); |
194 | 196 | printf("mirant memoria\r\n"); |
195 | 197 | int res=check_memory(); |
196 | 198 | if(res==SOFT_REACHED){ |
197 | 199 | printf("--------------soft limit-------------\r\n"); |
198 | - int j; | |
199 | - for(j=0;j<TOTAL_SENSORS;j++) | |
200 | - { | |
201 | - printf(" enviant buffer %d\r\n",j); | |
202 | - | |
203 | - // fem servir 085 de prova, però haurem de fer servir sensor_id[j] | |
204 | - int ok=send(buffers[j],&ind[j],&sizes[j], mod.ID, sensor_id[j]); | |
205 | - | |
206 | - if(ok==JSON_COMM_ERROR) | |
207 | - { | |
208 | - printf("wismart is not connected\r\n"); | |
209 | - } | |
210 | - else if( ok==JSON_OTHER_ERROR){ | |
211 | - printf("some error ocurred\r\n"); | |
212 | - } | |
213 | - else if(ok ==JSON_POST_OK){ | |
214 | - printf(" send OK \r\n"); | |
215 | - } | |
216 | - } | |
200 | + send_data(); | |
217 | 201 | } |
218 | 202 | else if(res==HARD_REACHED){ |
219 | 203 | printf("--------------hard limit-------------\r\n"); |
... | ... | @@ -247,8 +231,6 @@ int main(void) |
247 | 231 | } |
248 | 232 | } |
249 | 233 | } |
250 | - //a_cookedData = format_data(a_rawData, timestamp); | |
251 | - | |
252 | 234 | time += getElapsedTime(delay); |
253 | 235 | printf("time (absolute):\t%d\r\ntime mod LONG_PERIOD:\t%d\r\ntime mod SHORT_PERIOD:\t%d\r\n",time,time%LONG_PERIOD,time%SHORT_PERIOD); |
254 | 236 | ... | ... |