Closed mlej8 closed 2 years ago
Will not fully implement: "Route should return only once the BCI process is ready (sometimes the stream couldn't be resolved with the BCI Board, in this case we should return an error message telling the frontend to make sure the BCI board is well connected to the user's computer)",
Current implementation will return once BCI process is ready, or simply timeout.
Will consider returning the error message as a low priority feature, frontend should show an error for any response code other than 201.
Create a route in
dcp/api.py
which starts a BCI process to stream data from BCI device.bci_processes_state
shared variable which stores{process_id: {character, phase, frequency, q, config_id, collecting}}
. Initialize character, phase, frequency, q, config_id, collecting toNone
orFalse
according to the variableConfiguration
object and set its ID to theconfig_id
attribute inbci_processes_state[process_id]
process_id