arm-linux-阿里云SDK接入笔记2


```bash

```c
/lib/modules/4.1.15 # ./mqtt-example 
main|159 :: mqtt example 
establish tcp connection with server(host='g1uqs46Vt1T.iot-as-mqtt.cn-shanghai.aliyuncs.com', port=[1883]) success to establish tcp, fd=3

> {
>     "id": "1",
>     "version": "1.0",
>     "params": [
>         {
>             "attrKey": "SYS_LP_SDK_VERSION",
>             "attrValue": "3.0.1",
>             "domain": "SYSTEM"
>         },
>         {
>             "attrKey": "SYS_SDK_LANGUAGE",
>             "attrValue": "C",
>             "domain": "SYSTEM"
>         }
>     ],
>     "method": "thing.deviceinfo.update"
> }


> {
>     "id": "2",
>     "params": {
>         "version": "app-1.0.0-20180101.1000"
>     }
> }


> {
>     "message": "hello!"
> }

example_event_handle|128 :: msg->event_type : 9 example_event_handle|128 :: msg->event_type : 9 example_event_handle|128 :: msg->event_type : 3

< { <     "message": "hello!" < }

example_message_arrive|061 :: Message Arrived: example_message_arrive|062 :: Topic  : /g1uqs46Vt1T/2021_0111/user/get example_message_arrive|063 :: Payload: {"message":"hello!"} example_message_arrive|064 :: 


> {
>     "message": "hello!"
> }

注释了这句之后:// pthread_join (id_iaq, NULL);//lianghongxiao

/lib/modules/4.1.15 # ./mqtt-exmaple
-/bin/sh: ./mqtt-exmaple: not found
/lib/modules/4.1.15 # ./mqtt-example
main|159 :: mqtt example
establish tcp connection with server(host='g1uqs46Vt1T.iot-as-mqtt.cn-shanghai.aliyuncs.com'

再注释了这句之后:// HAL_ThreadCreate(&id_iaq, pthread_iaq,NULL,0);//lianghongxiao

main|159 :: mqtt example
establish tcp connection with server(host='g1uqs46Vt1T.iot-as-mqtt.cn-shanghai.aliyuncs.com', port=[1883])
success to establish tcp, fd=3

> {
>     "id": "1",
>     "version": "1.0",
>     "params": [
>         {
>             "attrKey": "SYS_LP_SDK_VERSION",
>             "attrValue": "3.0.1",
>             "domain": "SYSTEM"
>         },
>         {
>             "attrKey": "SYS_SDK_LANGUAGE",
>             "attrValue": "C",
>             "domain": "SYSTEM"
>         }
>     ],
>     "method": "thing.deviceinfo.update"
> }


> {
>     "id": "2",
>     "params": {
>         "version": "app-1.0.0-20180101.1000"
>     }
> }


> {
>     "message": "hello!"
> }

example_event_handle|128 :: msg->event_type : 9
example_event_handle|128 :: msg->event_type : 3
example_event_handle|128 :: msg->event_type : 9

< {
<     "message": "hello!"
< }

example_message_arrive|061 :: Message Arrived:
example_message_arrive|062 :: Topic  : /g1uqs46Vt1T/2021_0111/user/get
example_message_arrive|063 :: Payload: {"message":"hello!"}
example_message_arrive|064 :: 

把字符内容变成temp后:char *payload = temp;//lianghongxiao

main|159 :: mqtt example
establish tcp connection with server(host='g1uqs46Vt1T.iot-as-mqtt.cn-shanghai.aliyuncs.com', port=[1883])
success to establish tcp, fd=3

> {
>     "id": "1",
>     "version": "1.0",
>     "params": [
>         {
>             "attrKey": "SYS_LP_SDK_VERSION",
>             "attrValue": "3.0.1",
>             "domain": "SYSTEM"
>         },
>         {
>             "attrKey": "SYS_SDK_LANGUAGE",
>             "attrValue": "C",
>             "domain": "SYSTEM"
>         }
>     ],
>     "method": "thing.deviceinfo.update"
> }


> {
>     "id": "2",
>     "params": {
>         "version": "app-1.0.0-20180101.1000"
>     }
> }

example_event_handle|128 :: msg->event_type : 9
example_event_handle|128 :: msg->event_type : 3
example_message_arrive|061 :: Message Arrived:
example_message_arrive|062 :: Topic  : /g1uqs46Vt1T/2021_0111/user/get
example_message_arrive|063 :: Payload: 
example_message_arrive|064 :: 
  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值