MT_GetLEDStatus

■Description

Get status-LED status.

■Synopsis

MT_GetLEDStatus(fd, ucSLED)

■Argument

fd
[C/C++] int
[Python] ctypes.c_int
Please specify handle acquired by MT_Open function.
ucSLED
[C/C++] unsigned char *
[Python] ctypes.POINTER(ctypes.c_ubyte)
Specify the Pointer to a variable that stores the status LED status.
The value is as follows.
    0x00:  Off
    0x01:  Red On
    0x02:  Red Blink
    0x04:  Green On
    

■RETURN VALUE

[C/C++] int
[Python] ctypes.c_int
If the function succeeds, NO_ERROR is returned.
If the function fails, DRIVER_FAIL is returned.
The other errors : Error code details

■Sample Program Code

[C/C++]
  int fd;
  int ret = 0;
  unsigned char ledstatus = 0xff;

  if ( (fd = MT_Open(NULL) ) < 0) {
      printf("Faild to open i2c port\n");
      return 1;
  }

  ledstatus = 0x00;
  ret = MT_GetLEDStatus(fd, &ledstatus);
  if (ret == 0) {
      printf("Get LED status : %xh\n", ledstatus);
  }
  else {
      printf("MT_GetLEDStatus Failled %d\n", ret);
  }

  MT_Close(fd);
  
[Python]
  import ctypes
  import sys
  import mtdll_arm

  fd = mtdll_arm.MT_Open(None);
  if fd < 0:
      print("Faild to open i2c port");
      sys.exit()

  ledstatus = ctypes.c_ubyte();
  ret = mtdll_arm.MT_GetLEDStatus(fd, ledstatus);
  if ret == 0:
      print("Get LED status : ", '{:x}h'.format(ledstatus.value));
  else :
      print("MT_GetLEDStatus Failled [", '{:d}'.format(ret), "]");

  mtdll_arm.MT_Close(fd);
  



Function List