示教机械臂
Dependencies: MQTT SDFileSystem WIZnet_Library mbed
Fork of wmx_laser_copy by
Diff: networking.cpp
- Revision:
- 4:ae6f380a5b41
- Parent:
- 2:a50b794b8ede
- Child:
- 5:c5b3ccf99436
--- a/networking.cpp Sun Jul 22 07:50:47 2018 +0000 +++ b/networking.cpp Sun Jul 22 15:53:24 2018 +0000 @@ -8,7 +8,7 @@ //W5500接线 mosi,miso,sclk,cs,reset WIZnetInterface wiz(PB_5,PB_4,PB_3,PC_14,NC); //节点名称任取 -#define NODE_NAME "n_12345" +#define NODE_NAME "laser" //接在同一子网下的设备MAC地址必须不同 uint8_t mac_addr[6]={0x50,0x51,0x50,0x00,0x00,0x01}; @@ -49,7 +49,7 @@ void messageArrived(MQTT::MessageData& md) { MQTT::Message &message = md.message; -// pc.printf("messageArrived '%s' %d,%d\r\n", md.topicName.cstring, md.topicName.lenstring.len, message.payloadlen); + pc.printf("messageArrived %d,%d\r\n", md.topicName.lenstring.len, message.payloadlen); // char buf[64]; // int value, len = sizeof(buf)-1; @@ -88,7 +88,7 @@ void publish_value(MClient &client, const char *topic, const char *buf) { - meta_report(client, "values",topic,buf,strlen(buf),true); + meta_report(client, "values",topic,buf,strlen(buf),false); } void buildCapability(char *out, const char* infoList[][2])