MBED implementation of JAudioStream

JAudioStream.h

Committer:
ollie8
Date:
2015-08-13
Revision:
2:22ee01f24346
Parent:
1:b49a6e72f353
Child:
3:51a66c975910

File content as of revision 2:22ee01f24346:

#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

class JAudioStream {
    private:
        char* cont;
        char* cond;
        char* dcon;
        char* rqst;
        char* begn;
        char* comt;
        char* hrbt;
        EthernetInterface eth;
        UDPSocket udp;
        Endpoint endPoint;
        char* remoteIp;
        short remotePort;
        volatile bool connected;
        volatile bool inTransmission;
        void buildMeassge(char*, int, char*);
        void buildMeassge(char*, int, char*, char*);
        void intTocharArr(int, char*);
        void send(char*, short);
        char* nowPlaying;
    public:
        JAudioStream();
        bool connect(char *, short, char *);
        bool read(char*);
        bool isConnected();
        char* getNowPlaying();
        void request(char);
        void disconnect();
        bool available();
        void receive();
};

#endif