CC3200的httpserver例子上添加out_of_box例子demos-energy温度显示功能
原来httpserver例子中只有控制板上LED的功能
现在想移植out_of_box例子demos-energy页的温度显示功能到httpserver例子中
想实现的效果:
这个这里的温度一直都没读上来,一直显示“reloading”
程序中添加了一个GET指令了
case SL_NETAPP_HTTPGETTOKENVALUE_EVENT:
{
unsigned char status, *ptr;
ptr = pSlHttpServerResponse->ResponseData.token_value.data;
pSlHttpServerResponse->ResponseData.token_value.len = 0;
if(memcmp(pSlHttpServerEvent->EventData.httpTokenName.data,
GET_token_TEMP, strlen((const char *)GET_token_TEMP)) == 0)//__SL_G_UTP
{
float fCurrentTemp=0.0+k;
//TMP006DrvGetTemp(&fCurrentTemp);//读温度
char cTemp = (char)fCurrentTemp;
short sTempLen = itoa(cTemp,(char*)ptr);
ptr[sTempLen++] = ' ';
ptr[sTempLen] = 'F';
pSlHttpServerResponse->ResponseData.token_value.len += sTempLen;
}//------------------------------------------------------------
static unsigned char GET_token_TEMP[] = "__SL_G_UTP"