Beispiel #1
0
VMUINT8 gsm_sms_send(void* userdata)
{
	char* to = (char*)userdata;
	strcpy(g_sms_send_data.content, to);

	VMWCHAR number[42];
    VMWCHAR content[151];

    VMUINT8 res;

	vm_chset_ascii_to_ucs2(content, 151*2, g_sms_send_data.content);

	vm_chset_ascii_to_ucs2(number, 42*2, g_sms_send_data.number);

	res = vm_gsm_sms_send(number, content, sms_send_callback, NULL);

    if(res == 0)
    {
    	g_sms_send_data.result = TRUE;
    	vm_log_debug("sms send success!");
        return TRUE;
    }
    else
    {
		g_sms_send_data.result = FALSE;
		vm_log_debug("sms send fail!");
		return FALSE;
    }
}
Beispiel #2
0
int gsm_text(lua_State *L)
{
    VMWCHAR number[42];
    VMWCHAR content[100];
    const char *phone_number = luaL_checkstring(L, 1);
    const char *message = luaL_checkstring(L, 2);

    vm_chset_ascii_to_ucs2(content, 100*2, message);
	vm_chset_ascii_to_ucs2(number, 42*2, phone_number);


    lua_pushnumber(L, vm_gsm_sms_send(number, content, _gsm_text_callback, NULL));

    return 1;
}
boolean callvoiceCall(void* user_data)
{
  VMINT ret;
  call_info_struct* callInfo_p = (call_info_struct*)user_data;
  vm_gsm_tel_dial_action_request_t req;
  vm_gsm_tel_call_actions_data_t data;
  
  req.sim = VM_GSM_TEL_CALL_SIM_1;
  req.is_ip_dial = 0;
  req.module_id = 0;
  vm_chset_ascii_to_ucs2((VMWSTR)req.num_uri, VM_GSM_TEL_MAX_NUMBER_LENGTH, (VMSTR)callInfo_p->num);

  req.phonebook_data = NULL;

  data.action = VM_GSM_TEL_CALL_ACTION_DIAL;
  data.data_action = (void*)&req;
  //data.user_data = (void*)&callInfo_p->result;
  data.user_data = NULL;
  data.callback = _call_voiceCall_callback;  
  
  ret = vm_gsm_tel_call_actions(&data);
  
  vm_gsm_tel_set_output_device(VM_GSM_TEL_DEVICE_LOUDSPK);
  vm_gsm_tel_set_volume(VM_AUDIO_VOLUME_6);
  
  if(ret < 0)
  {
  	return false;
  }
  else
  {
  	callInfo_p->result = 1;
  	return true;
  }
}
int _open(const char* file, int flags, int mode)
{
    int result;
    VMUINT fs_mode;
    VMWCHAR wfile_name[32];
    char file_name[32];
    char* ptr;

    if(file[1] != ':') {
        snprintf(file_name, sizeof(file_name), "C:\\%s", file);
        ptr = file_name;
    } else {
        ptr = file;
    }

    vm_chset_ascii_to_ucs2(wfile_name, 32, ptr);

    if(flags & O_CREAT) {
        fs_mode = VM_FS_MODE_CREATE_ALWAYS_WRITE;
    } else if((flags & O_RDWR) || (flags & O_WRONLY)) {
        fs_mode = VM_FS_MODE_WRITE;
    } else {
        fs_mode = VM_FS_MODE_READ;
    }

    if(flags & O_APPEND) {
        fs_mode |= VM_FS_MODE_APPEND;
    }

    result = vm_fs_open(wfile_name, fs_mode, 0);
    LOG("_open(%s, 0x%X, 0x%X) - %d\n", file, flags, mode, result);
    return result;
}
Beispiel #5
0
//-------------------------------------------------------------
void full_fname(char *fname, VMWCHAR *ucs_name, int size)
{
	char file_name[128];
	const char *ptr;
	if (fname[1] != ':') {
		snprintf(file_name, 127, "C:\\%s", fname);
		ptr = file_name;
	}
	else ptr = fname;
	vm_chset_ascii_to_ucs2(ucs_name, size, ptr);
}
Beispiel #6
0
static v7_val_t gsm_text(struct v7* v7)
{
    VMWCHAR number[42];
    VMWCHAR content[100];
    v7_val_t numberv = v7_arg(v7, 0);
    v7_val_t messagev = v7_arg(v7, 1);
    const char* phone_number;
    const char* message;
    size_t len, message_len;

    if(!v7_is_string(numberv) || !v7_is_string(messagev)) {
        return v7_create_undefined();
    }

    phone_number = v7_to_string(v7, &numberv, &len);
    message = v7_to_string(v7, &messagev, &message_len);

    vm_chset_ascii_to_ucs2(content, 100 * 2, message);
    vm_chset_ascii_to_ucs2(number, 42 * 2, phone_number);

    return v7_create_number(vm_gsm_sms_send(number, content, _gsm_text_callback, NULL));
}
Beispiel #7
0
int _gsm_call(const char *phone_number) {
  vm_gsm_tel_dial_action_request_t req;
  vm_gsm_tel_call_actions_data_t data;

  vm_chset_ascii_to_ucs2((VMWSTR)req.num_uri, VM_GSM_TEL_MAX_NUMBER_LENGTH,
                         (VMSTR)phone_number);
  req.sim = VM_GSM_TEL_CALL_SIM_1;
  req.is_ip_dial = 0;
  req.module_id = 0;
  req.phonebook_data = NULL;

  data.action = VM_GSM_TEL_CALL_ACTION_DIAL;
  data.data_action = (void *)&req;
  data.user_data = NULL;
  data.callback = call_voiceCall_callback;

  return vm_gsm_tel_call_actions(&data);
}
/* The callback to be invoked by the system engine. */
void handle_sysevt(VMINT message, VMINT param) {
    switch (message) {
    case VM_EVENT_CREATE:
        break;
    case VM_EVENT_PAINT: {
        VMWCHAR path[100];
        VMINT fs = 0;
        VMCHAR flag = 0;
        VMCHAR write = 'a';
        VMINT write_size = 0;
        VMINT ret = 0;
        /* This file is a flag to not update the firmware after the firmware was updated and the board reboots.
           It's to prevent calling the update API in an endless loop. */
        vm_chset_ascii_to_ucs2(path, 100, "c:\\firmware.txt");
        fs = vm_fs_open(path,VM_FS_MODE_READ,FALSE);
        if(fs<0) {
            fs = vm_fs_open(path,VM_FS_MODE_CREATE_ALWAYS_WRITE,FALSE);
        }
        if(fs>=0) {
            vm_fs_read(fs,(void *)&flag,sizeof(VMCHAR),&write_size);
            if(flag==0) {
                vm_fs_seek(fs,0,VM_FS_BASE_BEGINNING);
                vm_fs_write(fs,(void *)&write,sizeof(VMCHAR),&write_size);
            }
            vm_fs_close(fs);
            if(flag=='a') {
                vm_log_info("firmware:have firmware update");
                ret = firmware_read_update_status();
                vm_log_info("firmware:update result = %d ",ret);
                vm_fs_delete(path);
            }
            if(flag==0) {
                vm_log_info("firmware update begin");
                vm_firmware_trigger_update();
                vm_log_info("firmware update end");
                vm_pwr_reboot();
            }
        }
    }
    break;
    default:
        break;
    }
}
boolean file_ext_create(void* user_data)
{
  file_info_struct* data_file = (file_info_struct*)user_data;
  
  VMCHAR filename[VM_FS_MAX_PATH_LENGTH] = {0};
  VMWCHAR wfilename[VM_FS_MAX_PATH_LENGTH] = {0};
  VM_FS_HANDLE filehandle = -1;

  sprintf((char*)filename, "%c:\\%s", vm_fs_get_internal_drive_letter(), data_file->filename);
  vm_chset_ascii_to_ucs2(wfilename, sizeof(wfilename), filename);

    if((filehandle = vm_fs_open(wfilename, VM_FS_MODE_CREATE_ALWAYS_WRITE, TRUE)) < 0)
    {
        vm_log_info("Failed to create file: %s",filename);
    //Serial1.print("Failed to create file.\r\n");
        return true;
    }
    vm_log_info("Success to create file: %s", filename);
    data_file->handle = filehandle;
  return true;
}
Beispiel #10
0
void fs_demo_find_files(void)
{
	VMCHAR filename[VM_FS_MAX_PATH_LENGTH] = { 0 };
	VMWCHAR wfilename[VM_FS_MAX_PATH_LENGTH] = { 0 };
	VM_FS_HANDLE filehandle = -1;
	vm_fs_info_ex_t fileinfo;
	VMINT ret = 0;

	vm_log_info("fs_demo_find_files - START");

	sprintf(filename, "%c:\\%s", vm_fs_get_removable_drive_letter(), "*");
	vm_chset_ascii_to_ucs2(wfilename, sizeof(wfilename), filename);

	filehandle = vm_fs_find_first_ex(wfilename, &fileinfo);
	if (filehandle >= 0)
			{
		do
		{
			vm_chset_ucs2_to_ascii(filename, sizeof(filename),
					fileinfo.full_filename);
			vm_log_info("Find out the file : %s", filename);

			/* find the next file */
			ret = vm_fs_find_next_ex(filehandle, &fileinfo);
		} while (0 == ret);

		vm_fs_find_close_ex(filehandle);

	}
	else
	{
		vm_log_info("Failed to find file.");
	}

	vm_log_info("fs_demo_find_files - END");

	return;
}
VMINT firmware_read_update_status() {
    VMINT fd = -1;
    VMINT32 ret = 1;
    vm_firmware_update_status_t update_info;
    VMWCHAR path[100];
    VMUINT read = 0;
    vm_chset_ascii_to_ucs2(path, 100, "c:\\update_status");
    fd = vm_fs_open(path, VM_FS_MODE_READ,TRUE);
    if (fd >= 0) {
        vm_fs_read(fd, (void *)&update_info, sizeof(update_info), &read);
        if (read == sizeof(update_info)) {
            ret = update_info.error_code;	/* refer to VM_FIRMWARE_UPDATE_RESULT in vmfirmware.h*/
        }
        else {
            ret = 2;	/*incorrect file size */
        }
        vm_fs_close(fd);
    }
    else {
        ret = 1;	/* file could not be found */
    }
    return ret;
}
Beispiel #12
0
void gui_draw_font( char chr, UG_S16 x, UG_S16 y, UG_COLOR fc, UG_COLOR bc, const UG_FONT* font)
{
    char str[2] = {0, 0};
    VMWCHAR s[4];                 /* string's buffer */
    VMUINT32 size;
    vm_graphic_color_argb_t color;      /* use to set screen and text color */

    uint16_t height = font->char_height;

    str[0] = chr;
    vm_chset_ascii_to_ucs2(s, 4, str);

    /* set color and draw text*/
    if (g_gui_last_color != fc) {
        vm_graphic_color_argb_t color;

        color.a = (uint8_t)(fc >> 24);
        color.r = (uint8_t)(fc >> 16);
        color.g = (uint8_t)(fc >> 8);
        color.b = (uint8_t) fc;

        vm_graphic_set_color(color);
        g_gui_last_color = fc;
    }
Beispiel #13
0
VMUINT8 audioPlay(StorageEnum drv, VMINT8 *songName)
{
	VMWCHAR path[256];
	VMCHAR path_a[256];
	vm_audio_play_parameters_t play_parameters;
	VM_AUDIO_VOLUME volume;

	strcpy((char*)m_path, songName);
	m_drv = drv;
	m_type = TRUE;

	if(m_drv == 0)
	{
		drv = vm_fs_get_internal_drive_letter();
	}
	else
	{
		drv = vm_fs_get_removable_drive_letter();
	}

	if(drv >= 0)
	{
		if(m_type)
		{
			sprintf(path_a,(const signed char*)"%c:\\%s", drv, (VMINT8*)m_path);
			vm_chset_ascii_to_ucs2(path, 256, path_a);
		}
		else
		{
			sprintf(path_a,(const signed char*)"%c:\\", drv);
			vm_chset_ascii_to_ucs2(path, 256, path_a);
			vm_wstr_concatenate(path, (VMWSTR)m_path);
		}
	}
	else
	{
		vm_log_info("AudioPlay get driver error");
		return FALSE;
	}

	// set play parameters
	memset(&play_parameters, 0, sizeof(vm_audio_play_parameters_t));
	play_parameters.filename = path;
	play_parameters.reserved = 0;  //
	play_parameters.format = VM_AUDIO_FORMAT_MP3; //
	//play_parameters.output_path = VM_AUDIO_DEVICE_SPEAKER2;
	//play_parameters.output_path = VM_AUDIO_DEVICE_LOUDSPEAKER;
	play_parameters.output_path = VM_AUDIO_DEVICE_SPEAKER_BOTH;
	play_parameters.async_mode = 0;
	play_parameters.callback = audio_play_callback;
	play_parameters.user_data = &status_result;

	g_handle = vm_audio_play_open(&play_parameters);

	if(g_handle >= VM_OK)
	{
	  vm_log_info("open success");
	  //*res = 0;
	}
	else
	{
	  vm_log_info("open failed");
	  //*res = -1;
	  return FALSE;
	}
	// start to play
	vm_audio_play_start(g_handle);
	// set volume
	// vm_audio_set_volume(VM_AUDIO_VOLUME_6);
	// register interrupt callback
	g_interrupt_handle = vm_audio_register_interrupt_callback(audio_play_callback,&status_result);
}
Beispiel #14
0
//==========================
int https_post(lua_State* L)
{
	int ret;

	vm_https_callbacks_t callbacks = { (vm_https_set_channel_response_callback)https_post_request_set_channel_rsp_cb,
    								   (vm_https_unset_channel_response_callback)https_unset_channel_rsp_cb,
									   (vm_https_release_all_request_response_callback)https_send_release_all_req_rsp_cb,
									   (vm_https_termination_callback)https_send_termination_ind_cb,
                                       (vm_https_send_response_callback)https_send_read_request_rsp_cb,
									   (vm_https_read_content_response_callback)https_send_read_read_content_rsp_cb,
                                       (vm_https_cancel_response_callback)https_send_cancel_rsp_cb,
									   (vm_https_status_query_response_callback)https_send_status_query_rsp_cb };

	size_t sl;
    const char* url = luaL_checklstring(L, 1, &sl);

    free_post_buffers();

    g_https_url = vm_calloc(sl+1);
	if (g_https_url == NULL) {
		return luaL_error(L, "url buffer allocation error");
	}
    strncpy(g_https_url, url, sl);
    int totalalloc = (sl+1);

    if ((!lua_istable(L, 2)) && (!lua_isstring(L, 2))) {
      free_post_buffers();
      return luaL_error(L, "POST data arg missing" );
    }

	if (lua_isstring(L, 2)) {
		g_post_type = 0;
		const char* pdata = luaL_checklstring(L, 2, &sl);
		if ((sl <= 0) || (pdata == NULL)) {
		    free_post_buffers();
			return luaL_error(L, "wrong post data");
		}
		g_postdata = vm_calloc(sl+1);
		if (g_postdata == NULL) {
		    free_post_buffers();
			return luaL_error(L, "buffer allocation error");
		}
	    totalalloc += (sl+1);

		strncpy(g_postdata, pdata, sl);
		g_postdata[sl] = '\0';
		g_postdata_len = sl;
	    vm_log_debug("[POST]: allocated memory = %d", totalalloc);
    }
    else if (lua_istable(L, 2)) {
		g_post_type = 1;

		// ** iterate the table to find number of entries and total data size
		int pdata_size = 0;
		int nentries = 0;
		int fnames_size = 0;
		int filenames_size = 0;
		int pathnames_size = 0;
        int err = 0;
        int nfileentry = 0;

	    lua_pushnil(L);  // first key
	    while (lua_next(L, 2) != 0) {
	      // Pops a key from the stack, and pushes a key-value pair from the table
	      // 'key' (at index -2) and 'value' (at index -1)
	      if ((lua_isstring(L, -1)) && (lua_isstring(L, -2))) {
	        size_t klen = 0;
	        size_t vlen = 0;
	        const char* key = lua_tolstring(L, -2, &klen);
	        const char* value = lua_tolstring(L, -1, &vlen);
	        if ((klen > 0) && (vlen > 0)) {
	        	nentries++;
	        	fnames_size += (klen+1);
	  	    	if (strstr(key, "file") == key) {
	  	    		if (nfileentry < 1) {
						nfileentry++;
						filenames_size += (vlen+1);

						char fn[128];
						short wfn[128];
						sprintf(fn, "C:\\%s", value);
						vm_chset_ascii_to_ucs2((VMWSTR)wfn, 256, fn);
						int fh = vm_fs_open(wfn, VM_FS_MODE_READ, VM_TRUE);
						if (fh < 0) {
							err++;
							vm_log_debug("[POST]: File '%s' not found",fn);
						}
						else vm_fs_close(fh);
						int fnmlen = (vm_wstr_string_length(wfn)+1)*2;
						pathnames_size += fnmlen;
	  	    		}
	  	    		else {
						vm_log_debug("[POST]: Only 1 file allowed!");
	  	    		}
		        }
	  	    	else pdata_size += (vlen+sizeof(int));
	        }
	      }
	      lua_pop(L, 1);  // removes 'value'; keeps 'key' for next iteration
	    }

	    if (nentries == 0) {
	        free_post_buffers();
			return luaL_error(L, "no post entries");
	    }
	    if (err != 0) {
	        free_post_buffers();
			return luaL_error(L, "file not found");
	    }

		// ** Allocate buffers
        g_post_context = vm_calloc(sizeof(vm_https_request_context_t));
		if (g_post_context == NULL) {
		    free_post_buffers();
			return luaL_error(L, "buffer allocation error 1");
		}
	    totalalloc += sizeof(vm_https_request_context_t);

	    g_post_content = vm_calloc(sizeof(vm_https_content_t)*nentries);
 		if (g_post_content == NULL) {
 		    free_post_buffers();
			return luaL_error(L, "buffer allocation error 2");
    	}
	    totalalloc += (sizeof(vm_https_content_t)*nentries);

	    if (pdata_size > 0) {
			g_postdata = vm_calloc(pdata_size);
			if (g_postdata == NULL) {
				free_post_buffers();
				return luaL_error(L, "buffer allocation error 3");
			}
		    totalalloc += pdata_size;
 		}

	    g_https_field_names = vm_calloc(fnames_size);
  		if (g_https_field_names == NULL) {
  		    free_post_buffers();
			return luaL_error(L, "buffer allocation error 4");
  		}
	    totalalloc += fnames_size;

	    if (filenames_size > 0) {
			g_https_file_names = vm_calloc(filenames_size);
			if (g_https_file_names == NULL) {
				free_post_buffers();
				return luaL_error(L, "buffer allocation error 5");
			}
		    totalalloc += filenames_size;
  		}
  		if (pathnames_size > 0) {
			g_https_path_names = vm_calloc(pathnames_size);
			if (g_https_path_names == NULL) {
				free_post_buffers();
				return luaL_error(L, "buffer allocation error 6");
			}
		    totalalloc += pathnames_size;
  		}
	    vm_log_debug("[POST]: allocated memory = %d", totalalloc);

        sprintf(g_https_url, url);

        g_post_context->number_entries = 0;
    	g_post_context->content = (vm_https_content_t *)g_post_content;
        g_post_context->header = CONTENT_TYPE_FORMDATA;
        g_post_context->header_length = strlen(CONTENT_TYPE_FORMDATA);
        g_post_context->post_segment = NULL;
        g_post_context->post_segment_length = 0;
        g_post_context->url = g_https_url;
        g_post_context->url_length = strlen(g_post_context->url);

		// ** iterate the table and populate data buffers
		vm_https_content_t cc;
		g_postdata_len = 0;
		fnames_size = 0;
		filenames_size = 0;
		pathnames_size = 0;
		nfileentry = 0;

	    lua_pushnil(L);
	    while (lua_next(L, 2) != 0) {
	      if ((lua_isstring(L, -1)) && (lua_isstring(L, -2))) {
	        size_t klen = 0;
	        size_t vlen = 0;
	        const char* key = lua_tolstring(L, -2, &klen);
	        const char* value = lua_tolstring(L, -1, &vlen);
	        if ((klen > 0) && (vlen > 0)) {
	          // field key & value are OK
			  g_post_context->number_entries++;

  	    	  if (strstr(key, "file") == key) {
  	    		if (nfileentry < 1) {
					nfileentry++;
					cc.data_type = VM_HTTPS_DATA_TYPE_FILE;
					cc.content_type = CONTENT_TYPE_OCTET;
					cc.content_type_length = strlen(CONTENT_TYPE_OCTET);

					// save file name & length
					sprintf(g_https_file_names+filenames_size, "%s", value);
					cc.filename = g_https_file_names+filenames_size;
					cc.filename_length = vlen;
					filenames_size += (vlen+1);

					// save local file path/name & length
					char fn[128];
					short wfn[128];
					sprintf(fn, "C:\\%s", value);
					vm_chset_ascii_to_ucs2((VMWSTR)wfn, 256, fn);
					int wfnlen = vm_wstr_copy(g_https_path_names+pathnames_size, wfn);
					cc.file_path_name = g_https_path_names+pathnames_size;
					cc.file_path_name_length = vm_wstr_string_length(cc.file_path_name);
					pathnames_size += ((cc.file_path_name_length+1)*2);

					// get file size
					int fh = vm_fs_open(cc.file_path_name, VM_FS_MODE_READ, VM_TRUE);
					VMUINT fsz;
					if (vm_fs_get_size(fh, &fsz) == 0)  cc.data_length = fsz;
					else cc.data_length = 0;
					vm_fs_close(fh);
  	    		}
	          }
	          else {
		       	cc.data_type = VM_HTTPS_DATA_TYPE_BUFFER;
  		        cc.content_type = CONTENT_TYPE_TEXT;
	  		    cc.content_type_length = strlen(CONTENT_TYPE_TEXT);
    	        cc.filename = "";
    	        cc.filename_length = 0;
    	  		cc.file_path_name = (VMWSTR)"\0\0";
    		    cc.file_path_name_length = 0;
				cc.data_length = vlen;       // field data length

				int dlen = vlen;
				memcpy(g_postdata+g_postdata_len, &dlen, sizeof(int));
				memcpy(g_postdata+g_postdata_len+sizeof(int), value, vlen);
	            g_postdata_len += (vlen+sizeof(int));
	          }

  	          cc.charset = VM_HTTPS_CHARSET_ASCII;
  	          // save field name & length
  		      sprintf(g_https_field_names+fnames_size, "%s", key);
  	          cc.name = g_https_field_names+fnames_size;
  	          cc.name_length = klen;  // field name length
  	          fnames_size += (klen+1);

  	          memcpy(g_post_content + (sizeof(vm_https_content_t) * (g_post_context->number_entries-1)), &cc, sizeof(vm_https_content_t));
	        }
	      }
	      // removes 'value'; keeps 'key' for next iteration
	      lua_pop(L, 1);
	    }
    }


    ret = vm_https_register_context_and_callback(gprs_bearer_type, &callbacks);
    if (ret != 0) {
		free_post_buffers();
        l_message(NULL, "register context & cb failed");
    }
    else {
    	ret = vm_https_set_channel(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
    }
    lua_pushinteger(L, ret);

	return 1;
}
Beispiel #15
0
/* Set font and draw hello world text */
static void draw_hello(void) {
	VMWSTR string;
	vm_graphic_color_argb_t color;
	vm_graphic_frame_t frame;
	vm_graphic_frame_t* frame_group[1];
	VMWCHAR font_path[FONT_PATH_MAX_LENGTH + 1];
	VMWSTR font_paths_group[1];
	VM_RESULT result;
	VMUINT32 pool_size;
	VMUINT32 size;

	vm_graphic_point_t positions[1] = { 0, 0 };

	frame.buffer_length = SCREEN_WIDTH * SCREEN_HEIGHT * 2;
	frame.buffer = vm_malloc_dma(frame.buffer_length);
	if (frame.buffer == NULL) {
		return;
	}

	frame.color_format = VM_GRAPHIC_COLOR_FORMAT_16_BIT;
	frame.height = SCREEN_HEIGHT;
	frame.width = SCREEN_WIDTH;
	frame_group[0] = &frame;

	string = vm_res_get_string(STR_ID_HELLO, &size);
	color.a = 255;
	color.r = 243;
	color.g = 154;
	color.b = 30;
	vm_graphic_set_color(color);
	vm_graphic_draw_solid_rectangle(&frame, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT);

	result = vm_graphic_get_font_pool_size(EXTERNAL_FONT_SIZE, 1,
	FONT_CACHE_SIZE, &pool_size);
	if (VM_IS_SUCCEEDED(result)) {
		font_pool = vm_malloc(pool_size);
		if (NULL != font_pool) {
			result = vm_graphic_init_font_pool(font_pool, pool_size);
		} else {
			vm_log_info("allocate font pool memory failed");
			return;
		}
	}
	if (!(VM_IS_SUCCEEDED(result))) {
		vm_log_info("init font pool failed");
		return;
	}
	vm_chset_ascii_to_ucs2(font_path, (FONT_PATH_MAX_LENGTH + 1) * 2,
	EXTERNAL_FONT_PATH);
	font_paths_group[0] = font_path;
	vm_graphic_reset_font();
	result = vm_graphic_set_font(font_paths_group, 1);
	if (!(VM_IS_SUCCEEDED(result))) {
		vm_log_info("set font failed");
	}

	color.r = 255;
	color.g = 255;
	color.b = 255;
	vm_graphic_set_color(color);
	vm_graphic_set_font_size(VM_GRAPHIC_LARGE_FONT);
	vm_log_info("String: %d, %d, %d, %d, %d, %d", string[0], string[1],
			string[2], string[3], string[4], string[5]);
	vm_graphic_draw_text(&frame, 1, 1, string);
#if defined(__HDK_LINKIT_ASSIST_2502__)
	vm_graphic_blt_frame(frame_group, positions, 1);
#endif
	vm_free(frame.buffer);
	vm_free(font_pool);
	font_pool = NULL;
}