Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: EthernetInterface FXOS8700Q HTTPClient HTTPD MQTTS SDFileSystem YodiwoPlegma mbed-rpc mbed-rtos mbed wolfSSL
yoplegma_things.h
00001 #ifndef __YOPLEGMA_THINGS_H__ 00002 #define __YOPLEGMA_THINGS_H__ 00003 00004 #include "MQTTClient.h" 00005 #include "MQTTSocket.h" 00006 00007 #include "yodiwo_api.h" 00008 #include <stdlib.h> 00009 00010 #define MAX_MSG_LEN 2500 00011 #define MAX_TOPIC_LEN 150 00012 00013 00014 typedef int (func_ToJson)(char *, size_t, void *); 00015 typedef Yodiwo_Plegma_Json_e (func_FromJson)(char *, size_t, void *); 00016 00017 int mqtt_init(char *hostname, int port, char *certfile, char *nodeKey, char *nodeSecret); 00018 void on_mqtt_message(MQTT::MessageData &msg); 00019 00020 int button_event(int buttonId, bool pressed); 00021 00022 typedef int (*portevent_handler_func)(Yodiwo_Plegma_PortEvent_t *event); 00023 00024 void initialize_things(char *nodeKey); 00025 int publisher(char *msg, int msg_len, char *msg_type); 00026 00027 00028 int handle_red_led(Yodiwo_Plegma_PortEvent_t *event); 00029 int handle_green_led(Yodiwo_Plegma_PortEvent_t *event); 00030 int handle_blue_led(Yodiwo_Plegma_PortEvent_t *event); 00031 00032 extern Array_Yodiwo_Plegma_Thing_t things; 00033 00034 void register_led_handlers(); 00035 00036 void axel_thread(const void *args); 00037 00038 #endif /* __YOPLEGMA_THINGS_H__ */
Generated on Tue Jul 12 2022 20:43:06 by
1.7.2