ThingPlug Test
Dependents: WizFi310_ThingPlug_Test WizFi310_ThingPlug_Test_P
Fork of WizFi310Interface by
Diff: WizFi310/WizFi310_at.cpp
- Revision:
- 7:b7019399eb1e
- Parent:
- 1:16e57103a7dd
- Child:
- 8:08588dd2a66f
--- a/WizFi310/WizFi310_at.cpp Mon Apr 10 09:54:34 2017 +0000 +++ b/WizFi310/WizFi310_at.cpp Fri Aug 25 00:55:43 2017 +0000 @@ -344,3 +344,75 @@ resp = sendCommand("AT+SMGMT=?", RES_SMGMT); return resp; } + + +int WizFi310::cmdSKTPCON ( const char *openType ) +{ + char cmd[CFG_CMD_SIZE]; + int resp; + + sprintf(cmd,"AT+SKTPCON=%s", openType); + resp = sendCommand(cmd); + + return resp; +} + +int WizFi310::cmdSKTPCON ( const char *openType, const char *clientId, const char *credentialId, const char *serviceId, const char *devId ) +{ + char cmd[CFG_CMD_SIZE]; + int resp; + + sprintf(cmd,"AT+SKTPCON=%s,mqtt.thingplug.net,1883,300,%s,%s,%s,v1_0,%s", openType, clientId, credentialId, serviceId, devId); + resp = sendCommand(cmd); + + return resp; +} + +int WizFi310::cmdSKTPDEVICE (const char *openType, const char *devId) +{ + char cmd[CFG_CMD_SIZE]; + int resp; + + sprintf(cmd,"AT+SKTPDEVICE=%s,%s", openType, devId); + resp = sendCommand(cmd); + + return resp; +} + +int WizFi310::cmdSKTPCONTAINER ( const char *openType, const char *containerName ) +{ + char cmd[CFG_CMD_SIZE]; + int resp; + + sprintf(cmd,"AT+SKTPCONTAINER=%s,%s", openType, containerName); + resp = sendCommand(cmd); + return resp; +} + +int WizFi310::cmdSKTPCMD ( const char *openType, const char *commandName ) +{ + char cmd[CFG_CMD_SIZE]; + int resp; + + sprintf(cmd,"AT+SKTPCMD=%s,%s", openType, commandName); + resp = sendCommand(cmd); + return resp; +} + +int WizFi310::cmdSKTPSEND ( const char *containerName, const char *sendData ) +{ + char cmd[CFG_CMD_SIZE]; + int resp; + + sprintf(cmd,"AT+SKTPSEND=%s,%s", containerName, sendData); + resp = sendCommand(cmd); + return resp; +} + +int WizFi310::cmdSKTPRESULT ( ) +{ + int resp; + + resp = sendCommand("AT+SKTPRESULT=?", RES_SMGMT); + return resp; +} \ No newline at end of file