ERIS CORE

◆ subscribe()

bool FLASHMEM SvcMIDI::subscribe ( uint16_t  app_id)

interface for apps to request a subscription to receive incoming MIDI messages through theIr message handlers

Parameters
app_id
Returns
true
false

Definition at line 155 of file SvcMIDI.cpp.

155  {
156  //find the next available slot
157  for(uint16_t i = 0; i < MAX_MIDI_MESSAGE_APP_SUBSCRIPTIONS; i ++){
158  if (subscriptions[i] == 0 || subscriptions[i] == app_id){
159  subscriptions[i] = app_id;
160  return true;
161  }
162  }
163  return false;
164 }
uint16_t subscriptions[MAX_MIDI_MESSAGE_APP_SUBSCRIPTIONS]
Definition: SvcMidi.h:54

References subscriptions.

Referenced by messageHandler().

+ Here is the caller graph for this function: