Prechádzať zdrojové kódy

Merge branch 'master' of https://github.com/Yaochenger/firemqtt

Yaochenger 7 mesiacov pred
rodič
commit
343fa06980
3 zmenil súbory, kde vykonal 5 pridanie a 6 odobranie
  1. 1 0
      README.md
  2. 1 0
      example/example.c
  3. 3 6
      port/port.c

+ 1 - 0
README.md

@@ -0,0 +1 @@
+Fire MQTT from CoreMQTT

+ 1 - 0
example/example.c

@@ -168,3 +168,4 @@ int mqtt_init(void)
     return 0;
 }
 MSH_CMD_EXPORT(mqtt_init, mqtt_init);
+

+ 3 - 6
port/port.c

@@ -8,8 +8,7 @@
 #include <string.h>
 #include "port.h"
 
-int32_t rtthread_send(NetworkContext_t * pNetworkContext, const void * pBuffer, size_t bytesToSend)
-{
+int32_t rtthread_send(NetworkContext_t * pNetworkContext, const void * pBuffer, size_t bytesToSend) {
     int socket = pNetworkContext->socket;
     int32_t bytesSent = send(socket, pBuffer, bytesToSend, 0);
     if (bytesSent < 0) {
@@ -18,8 +17,7 @@ int32_t rtthread_send(NetworkContext_t * pNetworkContext, const void * pBuffer,
     return bytesSent;
 }
 
-int32_t rtthread_recv(NetworkContext_t * pNetworkContext, void * pBuffer, size_t bytesToRecv)
-{
+int32_t rtthread_recv(NetworkContext_t * pNetworkContext, void * pBuffer, size_t bytesToRecv) {
     int socket = pNetworkContext->socket;
     int32_t bytesReceived = recv(socket, pBuffer, bytesToRecv, 0);
     if (bytesReceived < 0) {
@@ -28,7 +26,6 @@ int32_t rtthread_recv(NetworkContext_t * pNetworkContext, void * pBuffer, size_t
     return bytesReceived;
 }
 
-uint32_t getCurrentTime(void)
-{
+uint32_t getCurrentTime(void) {
     return rt_tick_get() * (1000 / RT_TICK_PER_SECOND);
 }