etrobocon2018 feat.KatLab  770af34cce41ae9c30c41303275e1add2daae0c3 (with uncommitted changes)
 全て クラス 名前空間 ファイル 関数 変数 列挙型 列挙値 フレンド マクロ定義 ページ
spp_master_test_api.c
[詳解]
1 //#include "api_common.h"
2 #include "ev3api.h"
3 #include "platform_interface_layer.h"
4 #include "syssvc/serial.h"
5 #include <stdlib.h>
6 #include <string.h>
7 
8 void spp_master_test_connect_ev3(const uint8_t addr[6], const char *pin) {
9  spp_master_test_connect(addr, pin); // TODO: check return value
10 }
11 
13  T_SERIAL_RPOR rpor;
14  ER ercd = serial_ref_por(SIO_PORT_SPP_MASTER_TEST, &rpor);
15  return ercd == E_OK;
16 }
17 
19  int fd = SIO_PORT_SPP_MASTER_TEST_FILENO;
20 
21  FILE *fp = fdopen(fd, "a+");
22  if (fp != NULL)
23  setbuf(fp, NULL); /* IMPORTANT! */
24  else assert(false); //API_ERROR("fdopen() failed, fd: %d.", fd);
25  return fp;
26 }
27 
bool_t spp_master_test_is_connected()
void spp_master_test_connect_ev3(const uint8_t addr[6], const char *pin)
FILE * spp_master_test_open_file()