Example program to create IoT devices for a local network, which connect to a local server.

Dependencies:   WebSocketClient WiflyInterface mbed messages

This code is used in the second part of my Internet of Things (IoT) blog post available here. The code is fairly simple, but its real value is in its reliability. I have worked hard to try to make the wireless connection as reliable, and as fast, as possible. There are a few lines of code that must be modified before it will work correctly, and those are described in the following Wiki pages.

It is designed to work with a Python WebSocket Server running on a PC, the source code of which is available here.

Once operating with the server, each microcontroller, or IoT device, will broadcast a counter and its internal temperature to your WebSocket Server.

Committer:
defrost
Date:
Tue Oct 04 11:34:47 2016 +0000
Revision:
0:c5607b31fb07
Child:
6:424e225d2a91
- Initial Commit

Who changed what in which revision?

UserRevisionLine numberNew contents of line
defrost 0:c5607b31fb07 1 // ******************
defrost 0:c5607b31fb07 2 // * iQ_StatusReg.h *
defrost 0:c5607b31fb07 3 // ******************
defrost 0:c5607b31fb07 4 //
defrost 0:c5607b31fb07 5 // Created: 2016/03/24
defrost 0:c5607b31fb07 6 // By: Damien Frost
defrost 0:c5607b31fb07 7 //
defrost 0:c5607b31fb07 8 // Status register class
defrost 0:c5607b31fb07 9
defrost 0:c5607b31fb07 10 #ifndef STATUSREG_H_
defrost 0:c5607b31fb07 11 #define STATUSREG_H_
defrost 0:c5607b31fb07 12
defrost 0:c5607b31fb07 13 #include "StatusReg.h"
defrost 0:c5607b31fb07 14
defrost 0:c5607b31fb07 15 /**
defrost 0:c5607b31fb07 16 * Interface using Wifly to connect to an IP-based network
defrost 0:c5607b31fb07 17 */
defrost 0:c5607b31fb07 18 class StatusReg{
defrost 0:c5607b31fb07 19 public:
defrost 0:c5607b31fb07 20 // Constructor
defrost 0:c5607b31fb07 21 StatusReg(void);
defrost 0:c5607b31fb07 22
defrost 0:c5607b31fb07 23 // Set a flag:
defrost 0:c5607b31fb07 24 void SetFlag(unsigned int flag);
defrost 0:c5607b31fb07 25
defrost 0:c5607b31fb07 26 // Clear a flag:
defrost 0:c5607b31fb07 27 void ClearFlag(unsigned int flag);
defrost 0:c5607b31fb07 28
defrost 0:c5607b31fb07 29 // Check for flag
defrost 0:c5607b31fb07 30 bool CheckFlag(unsigned int flag);
defrost 0:c5607b31fb07 31
defrost 0:c5607b31fb07 32 // Check for no flags
defrost 0:c5607b31fb07 33 bool AllClear(void);
defrost 0:c5607b31fb07 34
defrost 0:c5607b31fb07 35 // Get Register
defrost 0:c5607b31fb07 36 unsigned int GetReg(void);
defrost 0:c5607b31fb07 37
defrost 0:c5607b31fb07 38 private:
defrost 0:c5607b31fb07 39 unsigned int _reg;
defrost 0:c5607b31fb07 40 };
defrost 0:c5607b31fb07 41
defrost 0:c5607b31fb07 42
defrost 0:c5607b31fb07 43 #endif /* STATUSREG_H_ */