/* Update the MODE setting of the flash buffer.  */
static int32_t cn0503_flash_write_mode(struct cn0503_dev *dev, uint8_t *arg, uint8_t *buff)
/* Update the MODE setting of the flash buffer.  */
static int32_t cn0503_flash_write_mode(struct cn0503_dev *dev, uint8_t *arg, uint8_t *buff)
{
	int8_t i = 0;
	while(arg[i]) {
		arg[i] = toupper(arg[i]);
		i++;
	}
	i = 0;
	while(cn0503_ascii_modes[i][0] != 0) {
		if(strncmp((char *)arg, (char *)cn0503_ascii_modes[i], 5) == 0)
			break;
		i++;
	}
	if(i > CN0503_INS2)
		return FAILURE;
	sprintf((char *)buff, "%s", cn0503_ascii_modes[i]);
	dev->sw_flash_buffer[CN0503_FLASH_MODE_IDX] = i;
	return SUCCESS;
}