cc3000 hostdriver with the mbed socket interface
Fork of cc3000_hostdriver_mbedsocket by
Diff: cc3000.h
- Revision:
- 44:960b73df5981
- Parent:
- 43:864437b6c058
- Child:
- 45:50ab13d8f2dc
diff -r 864437b6c058 -r 960b73df5981 cc3000.h --- a/cc3000.h Sat Oct 12 23:28:22 2013 +0000 +++ b/cc3000.h Sun Oct 13 11:46:21 2013 +0200 @@ -50,71 +50,57 @@ #include "cc3000_socket.h" #define MAX_SOCKETS 4 -#define CC3000_ETH_COMPAT +// cc3000 Ethernet Interface - enabled by default +#define CC3000_ETH_COMPAT 1 -/** Enable debug messages, remove comment from the ones you want or all. - */ - +/** Enable debug messages - set 1 */ // Debug - Socket interface messages -//#define CC3000_DEBUG_SOCKET - +#define CC3000_DEBUG_SOCKET 0 // Debug - HCI TX messages -//#define CC3000_DEBUG_HCI_TX - +#define CC3000_DEBUG_HCI_TX 0 // Debug - HCI Rx messages -//#define CC3000_DEBUG_HCI_RX - +#define CC3000_DEBUG_HCI_RX 0 // Debug - General Debug -//#define CC3000_DEBUG - +#define CC3000_DEBUG 0 // Add colour to the debug messages, requires a VT100 terminal like putty, comment out to remove -//#define VT100_COLOUR +#define VT100_COLOUR 0 -#ifdef CC3000_DEBUG_SOCKET - - #ifdef VT100_COLOUR +#if (CC3000_DEBUG_SOCKET == 1) + #if (VT100_COLOUR == 1) #define DBG_SOCKET(x, ...) std::printf("\x1b[2;32;40m[CC3000 : SOCKET] "x"\x1b[0;37;40m\r\n", ##__VA_ARGS__); #else #define DBG_SOCKET(x, ...) std::printf("[CC3000 : SOCKET] "x"\r\n", ##__VA_ARGS__); #endif - #else #define DBG_SOCKET(x, ...) #endif -#ifdef CC3000_DEBUG_HCI_TX - - #ifdef VT100_COLOUR +#if (CC3000_DEBUG_HCI_TX == 1) + #if (VT100_COLOUR == 1) #define DBG_HCI(x, ...) std::printf("\x1b[2;35;40m[CC3000 : HCI RX] "x"\x1b[0;37;40m\r\n", ##__VA_ARGS__); #else #define DBG_HCI(x, ...) std::printf("[CC3000 : HCI RX] "x"\r\n", ##__VA_ARGS__); #endif - #else #define DBG_HCI(x, ...) #endif -#ifdef CC3000_DEBUG_HCI_RX - - #ifdef VT100_COLOUR +#if (CC3000_DEBUG_HCI_RX == 1) + #if (VT100_COLOUR == 1) #define DBG_HCI_CMD(x, ...) std::printf("\x1b[2;36;40m[CC3000 : HCI TX] "x"\x1b[0;37;40m\r\n", ##__VA_ARGS__); #else #define DBG_HCI_CMD(x, ...) std::printf("[CC3000 : HCI TX] "x"\r\n", ##__VA_ARGS__); #endif - #else #define DBG_HCI_CMD(x, ...) #endif - -#ifdef CC3000_DEBUG - - #ifdef VT100_COLOUR +#if (CC3000_DEBUG == 1) + #if (VT100_COLOUR == 1) #define DBG_CC(x, ...) std::printf("\x1b[2;32;40m[CC3000] "x"\x1b[0;37;40m\r\n", ##__VA_ARGS__); #else #define DBG_CC(x, ...) std::printf("[CC3000] "x"\r\n", ##__VA_ARGS__); #endif - #else #define DBG_CC(x, ...) #endif @@ -1001,7 +987,7 @@ */ int32_t mdns_advertiser(uint16_t mdns_enabled, uint8_t * device_service_name, uint16_t device_service_name_length); /** - * \brief + * \brief * \param[in] s_addr in host format ( little endian ) * \param[in] *buf buffer to write too * \param[in] buflen length of supplied buffer @@ -1706,32 +1692,36 @@ static cc3000 *get_instance() { return _inst; } -#ifdef CC3000_ETH_COMPAT +#if (CC3000_ETH_COMPAT == 1) /** - * \brief - * \param - * \return + * \brief Get the MAC address of your Ethernet interface. + * \param none + * \return + * Pointer to a string containing the MAC address. */ char* getMACAddress(); /** - * \brief - * \param - * \return + * \brief Get the IP address of your Ethernet interface. + * \param none + * \return + * Pointer to a string containing the IP address. */ char* getIPAddress(); /** - * \brief - * \param - * \return + * \brief Get the Gateway address of your Ethernet interface + * \param none + * \return + * Pointer to a string containing the Gateway address */ char* getGateway(); /** - * \brief - * \param - * \return + * \brief Get the Network mask of your Ethernet interface + * \param none + * \return + * Pointer to a string containing the Network mask */ char* getNetworkMask(); #endif