Exemplo n.º 1
0
static void ConnBTTasks() {
  switch (bt_state) {
    case STATE_BT_DISCONNECTED:
      if (USBHostBluetoothIsDeviceAttached()) {
        BTInit(buf, BUF_SIZE);
        bt_state = STATE_BT_INITIALIZING;
      }
      break;

    case STATE_BT_INITIALIZING:
    case STATE_BT_INITIALIZED:
      if (!USBHostBluetoothIsDeviceAttached()) {
        // disconnected
        BTShutdown();
        bt_state = STATE_BT_DISCONNECTED;
      } else {
#ifndef USB_ENABLE_TRANSFER_EVENT
        USBHostBluetoothTasks();
#endif
        BTTasks();
        bt_state = BTAccepting() ? STATE_BT_INITIALIZED : STATE_BT_INITIALIZING;
      }
      break;
  }
}
Exemplo n.º 2
0
int test_BTInit(tBTNodePtr *TempTree)			{
	solved=TRUE;
	BTInit(TempTree);
	if (!solved)	{
		printf("Operace InitList() nebyla implementovana \n");
		return(FALSE);
	}	
	else	
	{
	        Print_tree(*TempTree);
		return(TRUE);
	}
}