![]() |
firmwareSandsara
|
#include "Bluetooth.h"#include <Update.h>#include <SdFiles.h>#include <BLEDevice.h>#include <BLEUtils.h>#include <BLEServer.h>#include <BLE2902.h>#include <BLEAdvertisedDevice.h>#include "Motors.h"#include <EEPROM.h>#include <FastLED.h>
Classes | |
| class | bleServerCallback |
| [BLE] this class is used for debugging More... | |
| class | speedLedCallbacks |
| [BLE Command] This function is called when you write or read the ledSpeed characteristic More... | |
| class | cycleModeCallbacks |
| [BLE Command] This function is called when you write or read the cycleMode characteristic More... | |
| class | directionCallbacks |
| [BLE Command] This class is used to create an object to be called when you write the ledDirection characteristic. More... | |
| class | setBrightnessCallbacks |
| [BLE Command] This class is used to create an object to be called when you write the ledBrightness characteristic. More... | |
| class | selectedPaletteCallbacks |
| [BLE Command] This class is used to create and object to be called when you write the selectedPalette characteristic. More... | |
| class | CallbacksToUpdate |
| [BLE Command] This function is called when you write the UpdatePalette characteristic More... | |
| class | genericCallbacks |
| [BLE] we use this class for debugging More... | |
| class | playlistCallbacks_name |
| [BLE Command] This class is used to create an object to be called when you write or read the playlistName characteristic. More... | |
| class | playlistCallbacks_pathName |
| [BLE Command] This class is used to create an object to be called when you write or read the pathName characteristic. More... | |
| class | playlistCallbacks_pathPosition |
| [BLE Command] This class is used to create an object to be called when you write or read the pathPosition characteristic. More... | |
| class | playlistCallbacks_addPath |
| [BLE Command] Deprecated. More... | |
| class | playlistCallbacks_mode |
| [BLE Command] Deprecated. More... | |
| class | FilesCallbacks_receiveFlag |
| [BLE Command] This class is used to create an object to be called when you write the receiveFlag characteristic. More... | |
| class | FilesCallbacks_receive |
| [BLE Command] This class is used to create an object to be called when you write the FileReceive characteristic. More... | |
| class | FilesCallbacks_sendFlag |
| [BLE Command] This class is used to create and object to be called when you write the sendFlag characteristic. More... | |
| class | FilesCallbacks_send |
| [BLE Command] This class is used to create and object to be called when you write the sendFlag characteristic. More... | |
| class | FilesCallbacks_checkFile |
| [BLE Command] This class is used to create an object to be called when you write to the checkFile characteristic. More... | |
| class | FilesCallbacks_deleteFile |
| [BLE Command] This class is used to create an object to be called when you write to the deleteFile characteristic. More... | |
| class | generalCallbacks_name |
| [BLE Command] This class is used to create an object to be called when you write to the generalName characteristic. More... | |
| class | generalCallbacks_pause |
| [BLE Command] This class is used to create an object to be called when you write to the generalPause characteristic. More... | |
| class | generalCallbacks_play |
| [BLE Command] This class is used to create an object to be called when you write to the generalPlay characteristic. More... | |
| class | generalCallbacks_Sleep |
| [BLE Command] This class is used to create an object to be called when you write to the generalSleep characteristic. More... | |
| class | generalCallbacks_speed |
| [BLE Command] This class is used to create an object to be called when you write to the generalSpeed characteristic. More... | |
| class | generalCallbacks_restart |
| [BLE Command] This class is used to create an object to be called when you write to the generalRestart characteristic. More... | |
| class | generalCallbacks_factoryReset |
| [BLE Command] This class is used to create an object to be called when you write to the generalFactoryReset characteristic. More... | |
| class | generalCallbacks_status |
| [BLE Command] This class is used to create an object to be called when you write to the generalStatus characteristic. More... | |
| class | generalCallbacks_calibrating |
| [BLE Command] This class is used to create and object to be called when you write to the generalCalibraring characteristic. More... | |
| union | uwb |
| Las siguientes funciones se encargan de calcular el hash por el metodo de MD5. More... | |
Typedefs | |
| typedef union uwb | MD5union |
| Las siguientes funciones se encargan de calcular el hash por el metodo de MD5. More... | |
| typedef unsigned | DigestArray[4] |
| typedef unsigned(* | DgstFctn) (unsigned a[]) |
Functions | |
| int | romSetPlaylist (String) |
| actualiza el valor, en la ROM/FLASH, el nombre de la lista de reproducción. More... | |
| String | romGetPlaylist () |
| recupera el nombre de la playlist guardada en ROM More... | |
| int | romSetOrderMode (int) |
| guarda el tipo de orden de reporduccion en la memoria ROM More... | |
| int | romGetOrderMode () |
| recupera el valor correspondiente al tipo de reporduccion guardado en la memoria ROM. More... | |
| int | romSetPallete (int) |
| guarda la paleta de colores en rom More... | |
| int | romGetPallete () |
| recupera, de la ROM, la ultima palleta de colores guardada. More... | |
| int | romSetSpeedMotor (int) |
| guarda la velocidad de Sandsara en la ROM More... | |
| int | romGetSpeedMotor () |
| recupera, de la ROM, la velocidad de Sandsara. More... | |
| int | romSetPeriodLed (int) |
| guarda el tiempo de refresco de los leds en ROM. More... | |
| int | romGetPeriodLed () |
| recupera, de la ROM, el tiempo de refresco de los leds. More... | |
| int | romSetCustomPallete (uint8_t *, uint8_t *, uint8_t *, uint8_t *, int) |
| guarda una custom pallete en la memoria ROM. More... | |
| int | romSetBluetoothName (String) |
| guarda el nombre del dispositivo bluetooth. More... | |
| String | romGetBluetoothName () |
| recupera el nombre del bluetooth guardado en ROM More... | |
| int | romSetIntermediateCalibration (bool) |
| save the variable IntermediateCalibration in ROM. More... | |
| bool | romGetIntermediateCalibration () |
| get the variable IntermediateCalibration from ROM. More... | |
| int | romSetPositionList (int) |
| This function save the current playlist position in ROM. More... | |
| int | romGetPositionList () |
| restore the current position in the playlist in ROM. More... | |
| bool | romSetIncrementIndexPallete (bool) |
| guarda la variable incrementIndexPallete. More... | |
| int | romGetIncrementIndexPallete () |
| recupera la variable incrementIndexPallete. More... | |
| bool | romSetLedsDirection (bool) |
| stored the direction of leds in ROM. More... | |
| bool | romGetLedsDirection () |
| restored the direction of leds saved in ROM. More... | |
| int | romSetBrightness (uint8_t) |
| stored the brightness of the led strip in ROM. More... | |
| int | romGetBrightness () |
| to get the brightness of the led strip from ROM. More... | |
| void | changePalette (int) |
| Change the pallette of leds. More... | |
| int | stringToArray (String str, uint8_t *array, int n) |
| Convierte un string en un array un string de la forma x1,x2,...,xn se convierte en un array [0]=x1, [1]=x1, ...,[n-1]=xn. More... | |
| bool | sdExists (String) |
| esta funcion sirve para poder utilizar la funcion miembro "exists" de la libreria SdFat pero con un String como argumento. More... | |
| bool | sdRemove (String) |
| esta funcion sirve para poder utilizar la funcion miembro "remove" de la libreria SdFat pero con un String como argumento. More... | |
| int | performUpdate (Stream &updateSource, size_t updateSize) |
| Hasta aqui terminan las funciones para MD5. More... | |
| int | updateFromFS (SdFat &fs, String name) |
| Revisa si el archivo es valido y si lo es actualiza el firmware. More... | |
| int | programming (String name) |
| Intenta actualizar el firmware. More... | |
| void | rebootWithMessage (String reason) |
| Reinicia el Esp32 pero antes escribe un mensaje por Serial. More... | |
| String | GetMD5String (uint8_t *msg, int mlen) |
| typedef unsigned(* DgstFctn) (unsigned a[]) |
| typedef unsigned DigestArray[4] |
Las siguientes funciones se encargan de calcular el hash por el metodo de MD5.
| void changePalette | ( | int | pallet | ) |
Change the pallette of leds.
| pallet | indicates the index pallete to be choosed. |
| String GetMD5String | ( | uint8_t * | msg, |
| int | mlen | ||
| ) |
| int performUpdate | ( | Stream & | updateSource, |
| size_t | updateSize | ||
| ) |
Hasta aqui terminan las funciones para MD5.
Actualiza el firmware.
| int programming | ( | String | name | ) |
Intenta actualizar el firmware.
| void rebootWithMessage | ( | String | reason | ) |
Reinicia el Esp32 pero antes escribe un mensaje por Serial.
| String romGetBluetoothName | ( | ) |
recupera el nombre del bluetooth guardado en ROM
| int romGetBrightness | ( | ) |
to get the brightness of the led strip from ROM.
| bool romGetIncrementIndexPallete | ( | ) |
recupera la variable incrementIndexPallete.
| bool romGetIntermediateCalibration | ( | ) |
get the variable IntermediateCalibration from ROM.
| bool romGetLedsDirection | ( | ) |
restored the direction of leds saved in ROM.
| int romGetOrderMode | ( | ) |
recupera el valor correspondiente al tipo de reporduccion guardado en la memoria ROM.
| int romGetPallete | ( | ) |
recupera, de la ROM, la ultima palleta de colores guardada.
| int romGetPeriodLed | ( | ) |
recupera, de la ROM, el tiempo de refresco de los leds.
| String romGetPlaylist | ( | ) |
recupera el nombre de la playlist guardada en ROM
| int romGetPositionList | ( | ) |
restore the current position in the playlist in ROM.
| int romGetSpeedMotor | ( | ) |
recupera, de la ROM, la velocidad de Sandsara.
| int romSetBluetoothName | ( | String | str | ) |
guarda el nombre del dispositivo bluetooth.
| str | corresponde al nombre del bluetooth. |
| int romSetBrightness | ( | uint8_t | brightness | ) |
stored the brightness of the led strip in ROM.
| brightness | is the value to be stored. |
| int romSetCustomPallete | ( | uint8_t * | positions, |
| uint8_t * | red, | ||
| uint8_t * | green, | ||
| uint8_t * | blue, | ||
| int | numberOfColors | ||
| ) |
guarda una custom pallete en la memoria ROM.
| positions | es la posicion del color en la paleta de colores va de 0 a 255. |
| red | es un array que contiene los valores de Red de las posiciones en la paleta de colores. |
| green | es un array que contiene los valores de green de las posiciones en la paleta de colores. |
| blue | es un array que contiene los valores de blue de las posiciones en la paleta de colores. |
| int romSetIncrementIndexPallete | ( | bool | incrementIndex | ) |
guarda la variable incrementIndexPallete.
| incrementIndex | es el valor que se va a guardar. |
| int romSetIntermediateCalibration | ( | bool | state | ) |
save the variable IntermediateCalibration in ROM.
| state | is the value to be saved in ROM. |
| int romSetLedsDirection | ( | bool | direction | ) |
stored the direction of leds in ROM.
| direction | is the value to be stored. |
| int romSetOrderMode | ( | int | orderMode | ) |
guarda el tipo de orden de reporduccion en la memoria ROM
| orderMode | el valor que corresponde al orden de reproduccion que va a ser almacenado en ROM. |
| int romSetPallete | ( | int | pallete | ) |
guarda la paleta de colores en rom
| pallete | es un numero entero que indica la paleta de colres actual |
| int romSetPeriodLed | ( | int | periodLed | ) |
guarda el tiempo de refresco de los leds en ROM.
| periodLed | es el tiempo de refresco de los leds, medido en milisegundos. |
| int romSetPlaylist | ( | String | str | ) |
actualiza el valor, en la ROM/FLASH, el nombre de la lista de reproducción.
| str | es la dirección en la SD de la lista de reproducción, ejemplo "/animales.playlist". |
| int romSetPositionList | ( | int | pList | ) |
This function save the current playlist position in ROM.
| pList | is the currente position to be saved. |
| int romSetSpeedMotor | ( | int | speed | ) |
guarda la velocidad de Sandsara en la ROM
| speed | es la velocidad en milimetros por segundo de Sandsara. |
| bool sdExists | ( | String | dirName | ) |
esta funcion sirve para poder utilizar la funcion miembro "exists" de la libreria SdFat pero con un String como argumento.
| bool sdRemove | ( | String | dirName | ) |
esta funcion sirve para poder utilizar la funcion miembro "remove" de la libreria SdFat pero con un String como argumento.
| int stringToArray | ( | String | str, |
| uint8_t * | array, | ||
| int | n | ||
| ) |
Convierte un string en un array un string de la forma x1,x2,...,xn se convierte en un array [0]=x1, [1]=x1, ...,[n-1]=xn.
| str | Es el string que se desea convertir. |
| array | Es el array donde se van a guardar los valores del string |
| n | Es el numero de elementos que tiene el string |
| int updateFromFS | ( | SdFat & | fs, |
| String | name | ||
| ) |
Revisa si el archivo es valido y si lo es actualiza el firmware.
| String bluetoothNameGlobal |
| char buffer[10000] |
| int bufferSize |
| int changedPosition |
| String changedProgram |
| bool changePositionList |
| bool changeProgram |
| int delayLeds |
| BLECharacteristic* fileCharacteristic_delete |
| BLECharacteristic* fileCharacteristic_errorMsg |
| BLECharacteristic* fileCharacteristic_exists |
| BLECharacteristic* fileCharacteristic_receive |
| BLECharacteristic* fileCharacteristic_receiveFlag |
| BLECharacteristic* fileCharacteristic_send |
| BLECharacteristic* fileCharacteristic_sendFlag |
| File fileReceive |
| File fileSend |
| BLECharacteristic* generalCharacteristic_calibration |
| BLECharacteristic* generalCharacteristic_errorMsg |
| BLECharacteristic* generalCharacteristic_factoryReset |
| BLECharacteristic* generalCharacteristic_name |
| BLECharacteristic* generalCharacteristic_pause |
| BLECharacteristic* generalCharacteristic_play |
| BLECharacteristic* generalCharacteristic_restart |
| BLECharacteristic* generalCharacteristic_sleep |
| BLECharacteristic* generalCharacteristic_speed |
| BLECharacteristic* generalCharacteristic_status |
| BLECharacteristic* generalCharacteristic_version |
| bool incrementIndexGlobal |
| bool intermediateCalibration |
| BLECharacteristic* ledCharacteristic_amountColors |
| BLECharacteristic* ledCharacteristic_blue |
| BLECharacteristic* ledCharacteristic_brightness |
| BLECharacteristic* ledCharacteristic_cycleMode |
| BLECharacteristic* ledCharacteristic_direction |
| BLECharacteristic* ledCharacteristic_errorMsg |
| BLECharacteristic* ledCharacteristic_green |
| BLECharacteristic* ledCharacteristic_indexPalette |
| BLECharacteristic* ledCharacteristic_positions |
| BLECharacteristic* ledCharacteristic_red |
| BLECharacteristic* ledCharacteristic_speed |
| BLECharacteristic* ledCharacteristic_update |
| int ledModeGlobal |
| bool ledsDirection |
| int MAX_POSITIONLIST = String(String(dataS[59]) + String(dataS[60]) + String(dataS[61]) + String(dataS[62])).toFloat() |
| int MAX_REPRODUCTION_MODE = String(dataS[57]).toFloat() |
| int MIN_PALLETE = String(dataS[50]).toFloat() |
| int MIN_REPRODUCTION_MODE = String(dataS[55]).toFloat() |
| int MIN_SPEED_MOTOR = String(String(dataS[38])).toFloat() |
| int orderModeGlobal |
| bool pauseModeGlobal |
| int periodLedsGlobal |
| BLECharacteristic* playlistCharacteristic_addPath |
| BLECharacteristic* playlistCharacteristic_errorMsg |
| BLECharacteristic* playlistCharacteristic_mode |
| BLECharacteristic* playlistCharacteristic_name |
| BLECharacteristic* playlistCharacteristic_pathAmount |
| BLECharacteristic* playlistCharacteristic_pathName |
| BLECharacteristic* playlistCharacteristic_pathPosition |
| BLECharacteristic* playlistCharacteristic_progress |
| BLECharacteristic* playlistCharacteristic_readPath |
| BLECharacteristic* playlistCharacteristic_readPlaylistFlag |
| String playListGlobal |
| char* pointerB |
| bool readingSDFile |
| bool receiveFlag = false |
| bool rewindPlaylist |
| Motors Sandsara |
| SdFat SD |
| bool sendFlag = false |
| bool speedChangedMain |
| bool suspensionModeGlobal |