Ä¿¹Â´ÏƼ>°øÁö»çÇ×
   
   
 
    JSON Åë½Å »ç¿ë   2013.01.22
    JSON Åë½Å »ç¿ë
   
 
º¸³»´Â ºÎºÐ

void TransmitJSONPoweron(void)
{
usprintf(JsonWorkBuff,"DATA={\x22USC\x22:\x22POWERON\x22}\0");
// UARTSend(2,(unsigned char *)JsonWorkBuff,strlen(JsonWorkBuff));
hc_open(g_sParameters.ulRemoteIP);
}

¹ÞÀº µ¥ÀÌÅÍ Çؼ® ºÎºÐ

void ReceiveJSONProc(char *text)
{
unsigned long i,j,k,l,ulSize;
char *ptr=0;
char out[4];
char cVal;

ulSoftResetTimer=SOFTRSTTIME;
if(strlen(text)==0) return;


// UARTSend(2,(unsigned char *)text,strlen(text));

ptr=ustrstr(text,"MAP");
if(ptr !=NULL){
ptr=ustrstr(ptr,"US1");
if(ptr !=NULL){
HWREGBITW(&g_ulFlags, bJSON_NEW_MAP0)=1;
k=0;
j=0;
l=0;
ptr+=3; //skip us1
aMapSize0[0]=0;
//[[],[],[]]
for(i=0;i<NODE_SIZE;i++){
while(*ptr !=']'){
if((*ptr >=0x30) && (*ptr <=0x39)){
out[j]=*ptr;
j++;
}
if(*ptr ==','){ //string to int
if(j){
out[j]=0;
aMapData0[k]=(char)atoi(out);
j=0;
k++;
l++;
}
}
ptr++;
}
if(j){
out[j]=0;
aMapData0[k]=(char)atoi(out);
if(i==0){
aMapSize0[i+1]=++l;
}
else{
aMapSize0[i+1]=l;
}
aMapSize0[0]++;
}
ptr++;
l=0;
if(*ptr==']'){
break;
}
}
for(i=(int)aMapSize0[0]+1;i<50;i++){
aMapSize0[i]=0;
}
CheckMapUpdate(0);
}

}
else{
sprintf(WorkBuff,"NO MAP\0");
}


 
 
   
 
ÁÖ¼Ò: ÀÎõ±¤¿ª½Ã ¼­±¸ ºÀ¼ö´ë·Î 141 °¡Á½ùü°ø´Ü Bµ¿ 505È£    ´ëÇ¥ÀÚ : ±è½Ã¼®    ÀüÈ­¹øÈ£ : 032)672-2966    Æѽº¹øÈ£ : 032)672-2965
»ç¾÷ÀÚµî·Ï ¹øÈ£ : 225-14-00080    ÄÜÆ®·Ñ·¯°³¹ß,ÀüÀÚÁ¦Ç°°³¹ß ¾ÆÅ×Å©