Exemplo n.º 1
0
//cloud message recived handler
void cloudMsgArrivedHandler(void* context,
                            const char* topic, const unsigned int topicLen,
                            unsigned char *msg, unsigned int msgLen)
{
    app_context_t *inContext = (app_context_t*)context;

    //note: get data just for length=len is valid, because Msg is just a buf pionter.
    cloud_if_log("Cloud[%.*s] => KIT: [%d]=%.*s", topicLen, topic, msgLen, msgLen, msg);

    MicoFogCloudCloudMsgProcess(inContext, topic, topicLen, msg, msgLen);
}
Exemplo n.º 2
0
//cloud message recived handler
void cloudMsgArrivedHandler(void* context, 
                            const char* topic, const unsigned int topicLen,
                            unsigned char *msg, unsigned int msgLen)
{
  OSStatus err = kUnknownErr;
  mico_Context_t *inContext = (mico_Context_t*)context;
  
  //note: get data just for length=len is valid, because Msg is just a buf pionter.
  cloud_if_log("Cloud[%.*s] => MVD: [%d]=%.*s", topicLen, topic, msgLen, msgLen, msg);
  
  err = MicoFogCloudCloudMsgProcess(inContext, topic, topicLen, msg, msgLen);
  if(kNoErr != err){
    cloud_if_log("ERROR: MicoFogCloudCloudMsgProcess err=%d", err);
  }
}