MBED implementation of JAudioStream

Committer:
ollie8
Date:
Fri Aug 14 15:54:03 2015 +0000
Revision:
3:51a66c975910
Parent:
2:22ee01f24346
Child:
4:ebdd1cf0c9f7
Almost working, still fucked though!!

Who changed what in which revision?

UserRevisionLine numberNew contents of line
ollie8 0:6f03883f9b43 1 #ifndef JAUDIO_STREAM_H
ollie8 0:6f03883f9b43 2 #define JAUDIO_STREAM_H
ollie8 0:6f03883f9b43 3 #include "mbed.h"
ollie8 1:b49a6e72f353 4 #include "EthernetInterface.h"
ollie8 0:6f03883f9b43 5 #include "UDPSocket.h"
ollie8 0:6f03883f9b43 6
ollie8 3:51a66c975910 7 #define MAX_PACKT 48
ollie8 0:6f03883f9b43 8 #define MESSAGE_SIZE 8
ollie8 0:6f03883f9b43 9 #define MESSAGE_COMP_SIZE 4
ollie8 0:6f03883f9b43 10 #define REQUEST_RESPONSE_MODE 1
ollie8 0:6f03883f9b43 11
ollie8 0:6f03883f9b43 12 class JAudioStream {
ollie8 0:6f03883f9b43 13 private:
ollie8 2:22ee01f24346 14 char* cont;
ollie8 2:22ee01f24346 15 char* cond;
ollie8 2:22ee01f24346 16 char* dcon;
ollie8 2:22ee01f24346 17 char* rqst;
ollie8 2:22ee01f24346 18 char* begn;
ollie8 2:22ee01f24346 19 char* comt;
ollie8 2:22ee01f24346 20 char* hrbt;
ollie8 1:b49a6e72f353 21 EthernetInterface eth;
ollie8 3:51a66c975910 22 UDPSocket socket;
ollie8 1:b49a6e72f353 23 Endpoint endPoint;
ollie8 0:6f03883f9b43 24 char* remoteIp;
ollie8 0:6f03883f9b43 25 short remotePort;
ollie8 0:6f03883f9b43 26 volatile bool connected;
ollie8 0:6f03883f9b43 27 volatile bool inTransmission;
ollie8 2:22ee01f24346 28 void buildMeassge(char*, int, char*);
ollie8 2:22ee01f24346 29 void buildMeassge(char*, int, char*, char*);
ollie8 1:b49a6e72f353 30 void intTocharArr(int, char*);
ollie8 3:51a66c975910 31 void send(char*, int);
ollie8 0:6f03883f9b43 32 char* nowPlaying;
ollie8 0:6f03883f9b43 33 public:
ollie8 0:6f03883f9b43 34 JAudioStream();
ollie8 0:6f03883f9b43 35 bool connect(char *, short, char *);
ollie8 3:51a66c975910 36 bool read(char*, int);
ollie8 0:6f03883f9b43 37 bool isConnected();
ollie8 0:6f03883f9b43 38 char* getNowPlaying();
ollie8 0:6f03883f9b43 39 void request(char);
ollie8 0:6f03883f9b43 40 void disconnect();
ollie8 2:22ee01f24346 41 void receive();
ollie8 0:6f03883f9b43 42 };
ollie8 0:6f03883f9b43 43
ollie8 0:6f03883f9b43 44 #endif