Skip to content

Supported functions

Tomáš Kováčik edited this page Dec 2, 2018 · 2 revisions
BK3254((*wareSerial *ser, uint8_t resetPin) // constructor,1st parameter is pointer to serial device (HW,SW), 2nd is pin connected to reset pin of module

~BK3254() //desctructor

uint8_t sendData(String cmd) //send AT+cmd to serial

uint8_t sendCOMData(String cmd) //send COM+cmd to serial

uint8_t sendFMData(String cmd)  //send FM+cmd to serial

uint8_t sendBTData(String cmd) //send BT+cmd to serial

void resetModule() //HW reset of module via cycling state of reset pin low and back to high

uint8_t getNextEventFromBT(); //parse data send from module and set internal variales, call this periodicaly, to parse data received from module ASAP

uint8_t pairingInit(); //initialize pairing

uint8_t connectLastDevice(); //The last paired device connected (connect to last device?)

uint8_t disconnect(); //Disconect

uint8_t callAnsware(); //Answare the call

uint8_t callReject(); //Reject the call

uint8_t callHangUp(); //Hang up the call

uint8_t callRedial(); //Redial last number

uint8_t musicTogglePlayPause(); //toggle play and pause

uint8_t musicNextTrack(); //next track/FM next station

uint8_t fmNextTrack(); //alias for musicNextTrack

uint8_t musicPreviousTrack(); //previous track/FM next station

uint8_t fmPreviousTrack(); //alias for musicPreviousTrack

uint8_t volumeUp(); //increase volume

uint8_t volumeDown(); //decrease volume

uint8_t volumeSet(String volume); //set volume level directly, allowed values 0-15

uint8_t volumeGet(); //ask module to send current volume level, it is then stored in variable  currentVolume

uint8_t shutdown(); //shutdown, cycle power is required to woke up module

uint8_t standby(); //soft-off, powerup() works when module is put in standby

uint8_t powerup(); //wake up module from standby(soft off), did not work after shutdown() is called

uint8_t switchInput(); //switch to next input /mp3/TF/FM/BT/ .... somewhere there is aux,need to check

uint8_t switchInputToBluetooth();  //select BT

uint8_t switchInputToCard(); //select TF/SDcard

uint8_t switchInputToAux(); //select aux, this works only in  aux_det pin is pulled to ground

uint8_t switchInputToFm(); //select FM mode

uint8_t switchInputToUsb(); //select usb disk mode

uint8_t getCurrentInput(); //get currently selected input, module send event with this info, which is then stored in variable InputSelected

uint8_t musicModeRepeatAll(); //repeat all songs

uint8_t musicModeRepeatOne(); //repeat one song

uint8_t musicModeRepeatNone(); //repeat off (firmware v1.3 up)

uint8_t musicGetCurrentMode(); //get current mode of playback, this command module to send event telling what mode is set and then set variable ModeOfPlay

uint8_t musicPlaySong(uint16_t number); //play song number "number"

uint8_t cardGetCurrentPlayingSongNumber(); //command module to send current played song number, catched and stored in variable CurrentlyPlayingSong

uint8_t cardUsbGetSongsCount(); //command module to send event with info how much song we have on card or usb drive 

uint8_t usbGetCurrentPlayingSongNumber();  //command module to send event with number of currently played song

uint8_t fmStartSearch(); //start fm search

uint8_t fmStopSearch(); //stop fm search

uint8_t fmGetFreq(); //command module to send current tuned frequency, event send from module is then set at CurrentFrequency

uint8_t fmTunePreset(String preset); //tune preset number "preset"

uint8_t fmTuneFreq(String freq); //tune "freq" frequency

uint8_t fmGetFreq2() //command module to send current tuned frequency, event send from module is then set at CurrentFrequency

uint8_t fmGetPreset(); //command module to send current preset tuned this is then set in variable CurrentPreset

uint8_t fmGetFreqOfPreset(String preset); //command  module to send frequency of preset "preset"

uint8_t getAddress(); //command module to send bluetooth address as event, then this is stored in BT_ADDR

uint8_t getPinCode();//command module to send pin code as event, then this is stored in BT_PIN

uint8_t getName(); //command module to send bluetooth name as event, then this is stored in BT_NAME

uint8_t getConnectionStatus();  //command module to send event with status of bluetooth connection, stored in BTState( connected or disconnected)

uint8_t getMusicStatus(); //command module to send event with status of playback, returnd value is stored in MusicState

uint8_t getHFPStatus(); //command module to send event with status of HFP, state is stored in BTState( as Connected, Disconnected, CallInProgress, OutgoingCall or IncomingCall)

uint8_t changeName(String newName); //change name of Bluetooth module to "newName"

uint8_t changePin(String newPin); //change pin to "newPin"

## commands added in firmware v1.2

uint8_t voicesOn(); //enable voice information 

uint8_t voicesOff(); //disable voice information

uint8_t getVoicesState(); //get current state of voice info settings

uint8_t goBackOn(); // ?

uint8_t goBackOff(); //?

uint8_t getGoBack(); //?

uint8_t callOn(); //enable call function?

uint8_t callOff(); //disable call function?

uint8_t getCall(); //get status of call functionality 

uint8_t reboot(); //reboot module

## commands added in firmware V1.4

uint8_t autoPlayOn(); //enable auto play after power on

uint8_t autoPlayOff(); //disable auto play after power on

uint8_t getAutoPlay(); //get state of auto play settings