#include <vetprot.h>
Inheritance diagram for cornelluniversity::vetserial::mp3_play_request:
Public Member Functions | ||||||||||
mp3_play_request (void) | ||||||||||
Default constructor Zeroes out device, track, and duration. Be careful with duration, zero equals infinite play. | ||||||||||
mp3_play_request (const uint8_ dev, const uint8_ trk, const uint16_ dur=0) | ||||||||||
Overloaded constructor Accepts values for initializing device, track, and duration. Duration defualts to zero (infinite play). | ||||||||||
mp3_play_request (const uint8_ *in_pkt, uint32_ nbytes) | ||||||||||
Overloaded constructor Accepts packet and packet size for deserialization purposes. | ||||||||||
virtual | ~mp3_play_request (void) | |||||||||
const uint8_ | track (void) const | |||||||||
Track number private member accessor. | ||||||||||
void | track (const uint8_ track_number) | |||||||||
Track number private member mutator. | ||||||||||
const uint8_ | device (void) const | |||||||||
Device number private member accessor. | ||||||||||
void | device (const uint8_ device_number) | |||||||||
Device number private member mutator. | ||||||||||
const uint16_ | duration (void) const | |||||||||
Duration private member accessor The duration value is in milliseconds (i.e. 1000 will play for 1 second). | ||||||||||
void | duration (const uint16_ duration) | |||||||||
Duration value private member mutator. | ||||||||||
virtual void | serialize (void) | |||||||||
Overridden virtual function. Builds a play request packet by instantiating a header, adding the payload, and capping it off with a trailer. The full packet is left in buffer for you to access via this->packet().
| ||||||||||
virtual void | deserialize (void) | |||||||||
parses apart a received packet into the appropriate private members for use via the typical accessor process.
|
cornelluniversity::vetserial::mp3_play_request::mp3_play_request | ( | void | ) | [inline] |
Default constructor Zeroes out device, track, and duration. Be careful with duration, zero equals infinite play.
Determine the range of acceptble track numbers (255, but starting at zero or one)?
cornelluniversity::vetserial::mp3_play_request::mp3_play_request | ( | const uint8_ | dev, | |
const uint8_ | trk, | |||
const uint16_ | dur = 0 | |||
) | [inline] |
Overloaded constructor Accepts values for initializing device, track, and duration. Duration defualts to zero (infinite play).
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
cornelluniversity::vetserial::mp3_play_request::mp3_play_request | ( | const uint8_ * | in_pkt, | |
uint32_ | nbytes | |||
) | [inline] |
Overloaded constructor Accepts packet and packet size for deserialization purposes.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
virtual cornelluniversity::vetserial::mp3_play_request::~mp3_play_request | ( | void | ) | [inline, virtual] |
virtual void cornelluniversity::vetserial::mp3_play_request::deserialize | ( | void | ) | [virtual] |
parses apart a received packet into the appropriate private members for use via the typical accessor process.
cornelluniversity::vetsim_badchksum | if the crc validation fails | |
cornelluniversity::vetsim_exception | if the header size is deemed irregular | |
cornelluniversity::vetsim_exception | if packet_ buffer is empty (null pointer) |
Implements cornelluniversity::vetserial::base_command.
void cornelluniversity::vetserial::mp3_play_request::device | ( | const uint8_ | device_number | ) | [inline] |
Device number private member mutator.
device_number | - unsigned char based device number to be accessed |
const uint8_ cornelluniversity::vetserial::mp3_play_request::device | ( | void | ) | const [inline] |
Device number private member accessor.
void cornelluniversity::vetserial::mp3_play_request::duration | ( | const uint16_ | duration | ) | [inline] |
Duration value private member mutator.
duration | - unsigned short based duration value. The duration value is in milliseconds (i.e. 1000 will play for 1 second). Setting the duration to zero plays the track until told to stop. |
const uint16_ cornelluniversity::vetserial::mp3_play_request::duration | ( | void | ) | const [inline] |
Duration private member accessor The duration value is in milliseconds (i.e. 1000 will play for 1 second).
virtual void cornelluniversity::vetserial::mp3_play_request::serialize | ( | void | ) | [virtual] |
Overridden virtual function. Builds a play request packet by instantiating a header, adding the payload, and capping it off with a trailer. The full packet is left in buffer for you to access via this->packet().
std::bad_alloc | standard memory allocation failure. |
Implements cornelluniversity::vetserial::base_command.
void cornelluniversity::vetserial::mp3_play_request::track | ( | const uint8_ | track_number | ) | [inline] |
Track number private member mutator.
track_number | - unsigned char based track number to be played |
const uint8_ cornelluniversity::vetserial::mp3_play_request::track | ( | void | ) | const [inline] |
Track number private member accessor.