NTX-McGill/NeuroTechX-McGill-2021

Software (Backend): Start BCI Process

Closed this issue · 1 comments

mlej8 commented

Create a route in dcp/api.py which starts a BCI process to stream data from BCI device.

  • 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)
  • update the bci_processes_state shared variable which stores {process_id: {character, phase, frequency, q, config_id, collecting}}. Initialize character, phase, frequency, q, config_id, collecting to None or False according to the variable
  • In the stream.py, create a Configuration object and set its ID to the config_id attribute in bci_processes_state[process_id]
  • on success, should return process_id
  • on failure return error message

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.