MBED implementation of JAudioStream
JAudioStream.h
- Committer:
- ollie8
- Date:
- 2015-08-13
- Revision:
- 1:b49a6e72f353
- Parent:
- 0:6f03883f9b43
- Child:
- 2:22ee01f24346
File content as of revision 1:b49a6e72f353:
#ifndef JAUDIO_STREAM_H #define JAUDIO_STREAM_H #include "mbed.h" #include "EthernetInterface.h" #include "UDPSocket.h" #define MAX_PACKT 24 #define MESSAGE_SIZE 8 #define MESSAGE_COMP_SIZE 4 #define REQUEST_RESPONSE_MODE 1 #define PORT 7777 const char* cont = "cont"; const char* cond = "cond"; const char* dcon = "dcon"; const char* rqst = "rqst"; const char* begn = "begn"; const char* comt = "comt"; class JAudioStream { private: // use DHCP EthernetInterface eth; UDPSocket udp; Endpoint endPoint; char* remoteIp; short remotePort; volatile bool connected; volatile bool inTransmission; void buildMeassge(const char*, int, char*); void buildMeassge(const char*, int, char*, char*); void intTocharArr(int, char*); void send(char*, short); char* nowPlaying; public: JAudioStream(); void begin(char *, char *, short); bool connect(char *, short, char *); bool read(char*, short, short); bool isConnected(); char* getNowPlaying(); void request(char); void disconnect(); bool available(); }; #endif