StreamDock Base Class
The control classes of all specific device models need to inherit the StreamDock base class. The StreamDock base class provides the following methods:
Get the firmware version of the device
/*
@note: Get the firmware version of the device
@param lenth: The length of the firmware version
@return Returns the first address of the array where the firmware version number is stored. If an error occurs, return null
*/
virtual unsigned char *getFirmVersion(int lenth );
Open the device
/*
@note: Open the device
*/
int open();
Close the device
int disconnected();
Set the brightness of the device screen
/*
@note: Set the brightness of the device screen. If the value passed in is less than 0, the value will be pulled back to 0, and if it is greater than 1, it will be pulled back to 100
@param percent: Brightness value 1-100
@return Success returns 0, if an error returns -1
*/
virtual int setBrightness(int percent);
Set the background image of the device screen
/*
@note: Set the background image of the device screen
@param path: The path of the image
@return Success returns 1, if an error returns -1
*/
virtual int setBackgroundImg(std::string path);
Receive information sent by the device
/*
@note: Receive information sent by the device
@return Success returns the first address of the array obtained, if an error returns NULL
*/
virtual unsigned char * read();
Set the icon of the device button
/*
@note: Set the icon of the device button
@param path: The path of the image
@return Success returns 1, if an error returns -1
*/
virtual int setKeyImg(std::string path, int key);
Clear a key icon
/*
@note: Clear the key icon
@param index: The label of the key
@return: Success returns 1, failure returns -1
*/
virtual int clearIcon(int index);
Clear all key icons
/*
@note: Clear all key icons
@return: Success returns 1, failure returns -1
*/
virtual int clearAllIcon();
Refresh the display after data transmission is completed
/*
@note: Refresh the display after data transmission is completed
@return: Return 1 if successful, -1 if failed
*/
virtual int wakeScreen();
Refresh the display after data transmission is completed
/*
@note: Refresh the display after data transmission is completed
*/
int refresh();