• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ dbus_send函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中dbus_send函数的典型用法代码示例。如果您正苦于以下问题:C++ dbus_send函数的具体用法?C++ dbus_send怎么用?C++ dbus_send使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了dbus_send函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: ti85_send_VAR

/* Variable (std var header: NUL padded, variable length) */
int ti85_send_VAR(CalcHandle* handle, uint16_t varsize, uint8_t vartype, const char *varname)
{
  uint8_t buffer[16];
  char trans[17];

  buffer[0] = LSB(varsize);
  buffer[1] = MSB(varsize);
  buffer[2] = vartype;


  ticonv_varname_to_utf8_s(handle->model, varname, trans, vartype);
  ticalcs_info(" PC->TI: VAR (size=0x%04X, id=%02X, name=%s)",
	  varsize, vartype, trans);

  if (vartype != TI8586_BKUP) 
  {	// backup: special header
    buffer[3] = strlen(varname);
    memcpy(buffer + 4, varname, 8);
    TRYF(dbus_send(handle, PC_TI8586, CMD_VAR, 4 + strlen(varname), buffer));
  } 
  else 
  {
    memcpy(buffer + 3, varname, 6);
    TRYF(dbus_send(handle, PC_TI8586, CMD_VAR, 9, buffer));
  }

  return 0;
}
开发者ID:debrouxl,项目名称:tilp-libticalcs,代码行数:29,代码来源:cmd85.c


示例2: ti73_send_VAR_h

/* Variable (std var header: NUL padded, fixed length) */
int ti73_send_VAR_h(CalcHandle* handle, uint16_t varsize, uint8_t vartype, const char *varname, uint8_t varattr)
{
  uint8_t buffer[16];

  buffer[0] = LSB(varsize);
  buffer[1] = MSB(varsize);
  buffer[2] = vartype;
  memcpy(buffer + 3, varname, 8);
  buffer[11] = 0x00;
  buffer[12] = (varattr == ATTRB_ARCHIVED) ? 0x80 : 0x00;

  ticalcs_info(" PC->TI: VAR (size=0x%04X, id=%02X, name=%s, attr=%i)",
		varsize, vartype, varname, varattr);

  if (vartype != TI7383_BKUP) 
  {	// backup: special header
    pad_buffer(buffer + 3, '\0');
    TRYF(dbus_send(handle, PC_TI7383, CMD_VAR, 11 + EXTRAS, buffer));
  } 
  else 
  {
    TRYF(dbus_send(handle, PC_TI7383, CMD_VAR, 9, buffer));
  }

  return 0;
}
开发者ID:TI8XEmulator,项目名称:graph89,代码行数:27,代码来源:cmd73.c


示例3: ti82_send_VAR_h

/* Variable (std var header: NUL padded, fixed length) */
int ti82_send_VAR_h(CalcHandle* handle, uint16_t varsize, uint8_t vartype, const char *varname)
{
	uint8_t buffer[16];
	char trans[17];

	buffer[0] = LSB(varsize);
	buffer[1] = MSB(varsize);
	buffer[2] = vartype;
	memcpy(buffer + 3, varname, 8);

	ticonv_varname_to_utf8_s(handle->model, varname, trans, vartype);
	ticalcs_info(" PC->TI: VAR (size=0x%04X=%i, id=%02X, name=%s)",
	  varsize, varsize, vartype, trans);

	if (vartype != TI8283_BKUP) 
	{	
		// backup: special header
		pad_buffer(buffer + 3, '\0');
		TRYF(dbus_send(handle, PC_TI8283, CMD_VAR, 11, buffer));
	} 
	else 
	{

		TRYF(dbus_send(handle, PC_TI8283, CMD_VAR, 9, buffer));
	}

	return 0;
}
开发者ID:TI8XEmulator,项目名称:graph89,代码行数:29,代码来源:cmd82.c


示例4: ti85_send_REQ

/* Variable request (var header: NUL padded, fixed length) */
int ti85_send_REQ(CalcHandle* handle, uint16_t varsize, uint8_t vartype, const char *varname)
{
  uint8_t buffer[16] = { 0 };
  char trans[9];

  buffer[0] = LSB(varsize);
  buffer[1] = MSB(varsize);
  buffer[2] = vartype;
  buffer[3] = strlen(varname);
  memcpy(buffer + 4, varname, 8);

  ticonv_varname_to_utf8_s(handle->model, varname, trans, vartype);
  ticalcs_info(" PC->TI: REQ (size=0x%04X, id=%02X, name=%s)",
	  varsize, vartype, trans);
  if ((handle->model == CALC_TI86) && (vartype >= TI86_DIR) && (vartype <= TI86_ZRCL)) 
  {
    memset(buffer, 0, 9);
    buffer[2] = vartype;
    TRYF(dbus_send(handle, PC_TI86, CMD_REQ, 5, buffer));
  } 
  else if((handle->model == CALC_TI86) && (vartype == TI86_BKUP))
  {
	  memset(buffer, 0, 12);
	  buffer[2] = vartype;
      TRYF(dbus_send(handle, PC_TI86, CMD_REQ, 11, buffer));
  }
  else
  {
    pad_buffer_to_8_chars(buffer + 4, '\0');
    TRYF(dbus_send(handle, PC_TI8586, CMD_REQ, 4 + strlen(varname), buffer));
  }

  return 0;
}
开发者ID:debrouxl,项目名称:tilp-libticalcs,代码行数:35,代码来源:cmd85.c


示例5: ti73_send_REQ_h

/* Request variable (std var header: NUL padded, fixed length) */
int ti73_send_REQ_h(CalcHandle* handle, uint16_t varsize, uint8_t vartype, const char *varname,
		  uint8_t varattr)
{
  uint8_t buffer[16] = { 0 };
  char trans[17];

  buffer[0] = LSB(varsize);
  buffer[1] = MSB(varsize);
  buffer[2] = vartype;
  memcpy(buffer + 3, varname, 8);
  pad_buffer(buffer + 3, '\0');
  buffer[11] = 0x00;
  buffer[12] = (varattr == ATTRB_ARCHIVED) ? 0x80 : 0x00;

  ticonv_varname_to_utf8_s(handle->model, varname, trans, vartype);
  ticalcs_info(" PC->TI: REQ (size=0x%04X, id=%02X, name=%s, attr=%i)",
       varsize, vartype, trans, varattr);

  if (vartype != TI83p_IDLIST && vartype != TI83p_GETCERT) 
  {
    TRYF(dbus_send(handle, PC_TI7383, CMD_REQ, 11 + EXTRAS, buffer));
  } 
  else if(vartype != TI83p_GETCERT && handle->model != CALC_TI73)
  {
    TRYF(dbus_send(handle, PC_TI7383, CMD_REQ, 11, buffer));
  }
  else
  {
	  TRYF(dbus_send(handle, PC_TI73, CMD_REQ, 3, buffer));
  }

  return 0;
}
开发者ID:TI8XEmulator,项目名称:graph89,代码行数:34,代码来源:cmd73.c


示例6: ti73_send_VAR

/* Variable (std var header: NUL padded, fixed length) */
TIEXPORT3 int TICALL ti73_send_VAR(CalcHandle* handle, uint16_t varsize, uint8_t vartype, const char *varname, uint8_t varattr)
{
	uint8_t buffer[16];

	if (varname == NULL)
	{
		ticalcs_critical("%s: varname is NULL", __FUNCTION__);
		return ERR_INVALID_PACKET;
	}

	buffer[0] = LSB(varsize);
	buffer[1] = MSB(varsize);
	buffer[2] = vartype;
	memcpy(buffer + 3, varname, 8);
	buffer[11] = 0x00;
	buffer[12] = (varattr == ATTRB_ARCHIVED) ? 0x80 : 0x00;

	ticalcs_info(" PC->TI: VAR (size=0x%04X, id=%02X, name=%s, attr=%i)", varsize, vartype, varname, varattr);

	if (vartype != TI7383_BKUP)
	{
		// backup: special header
		pad_buffer_to_8_chars(buffer + 3, '\0');
		TRYF(dbus_send(handle, PC_TI7383, CMD_VAR, 11 + EXTRAS, buffer));
	} 
	else 
	{
		TRYF(dbus_send(handle, PC_TI7383, CMD_VAR, 9, buffer));
	}

	return 0;
}
开发者ID:debrouxl,项目名称:tilp-libticalcs,代码行数:33,代码来源:cmd73.c


示例7: ti73_send_SKP

/*
  Skip variable
  - rej_code [in]: a rejection code
  - int [out]: an error code
 */
TIEXPORT3 int TICALL ti73_send_SKP(CalcHandle* handle, uint8_t rej_code)
{
	TRYF(dbus_send(handle, PC_TI7383, CMD_SKP, 1, &rej_code));
	ticalcs_info(" PC->TI: SKP (rejection code = %i)", rej_code);

	return 0;
}
开发者ID:debrouxl,项目名称:tilp-libticalcs,代码行数:12,代码来源:cmd73.c


示例8: ti73_send_ERR_h

int ti73_send_ERR_h(CalcHandle* handle)
{
  ticalcs_info(" PC->TI: ERR");
  TRYF(dbus_send(handle, PC_TI7383, CMD_ERR, 2, NULL));

  return 0;
}
开发者ID:TI8XEmulator,项目名称:graph89,代码行数:7,代码来源:cmd73.c


示例9: ti82_send_EOT_h

int ti82_send_EOT_h(CalcHandle* handle)
{
  ticalcs_info(" PC->TI: EOT");
  TRYF(dbus_send(handle, PC_TI8283, CMD_EOT, 2, NULL));

  return 0;
}
开发者ID:TI8XEmulator,项目名称:graph89,代码行数:7,代码来源:cmd82.c


示例10: ti89_send_RTS

TIEXPORT3 int TICALL ti89_send_RTS(CalcHandle* handle, uint32_t varsize, uint8_t vartype, const char *varname)
{
	uint8_t buffer[32];
	uint16_t len;

	VALIDATE_HANDLE(handle);
	VALIDATE_NONNULL(varname);
	len = (uint16_t)strlen(varname);
	if (len > 17)
	{
		ticalcs_critical("Oversized variable name has length %i, clamping to 17", len);
		len = 17;
	}

	buffer[0] = LSB(LSW(varsize));
	buffer[1] = MSB(LSW(varsize));
	buffer[2] = LSB(MSW(varsize));
	buffer[3] = MSB(MSW(varsize));
	buffer[4] = vartype;
	buffer[5] = len;
	memcpy(buffer + 6, varname, len);
	buffer[6 + len] = 0x00;

	len += 6 + 1;
	// used by AMS <= 2.09 ?
	//if ((vartype == TI89_AMS) || (vartype == TI89_APPL)) len--;

	ticalcs_info(" PC->TI: RTS (size=0x%08X=%i, id=%02X, name=%s)", varsize, varsize, vartype, varname);
	return dbus_send(handle, ti68k_handle_to_dbus_mid(handle), DBUS_CMD_RTS, len, buffer);
}
开发者ID:TC01,项目名称:tilibs,代码行数:30,代码来源:cmd68k.c


示例11: ti89_send_XDP_h

int ti89_send_XDP_h(CalcHandle* handle, uint32_t length, uint8_t * data)
{
    ticalcs_info(" PC->TI: XDP (0x%04X = %i)", length, length);
    TRYF(dbus_send(handle, PC_TI9X, CMD_XDP, length, data));

    return 0;
}
开发者ID:tobiasBora,项目名称:emacs_ti,代码行数:7,代码来源:cmd89.c


示例12: ti85_send_ERR

int ti85_send_ERR(CalcHandle* handle)
{
  ticalcs_info(" PC->TI: ERR");
  TRYF(dbus_send(handle, PC_TI8586, CMD_ERR, 2, NULL));

  return 0;
}
开发者ID:debrouxl,项目名称:tilp-libticalcs,代码行数:7,代码来源:cmd85.c


示例13: ti68k_send_VAR

TIEXPORT3 int TICALL ti68k_send_VAR(CalcHandle* handle, uint32_t varsize, uint8_t vartype, const char *varname, uint8_t target)
{
	uint8_t buffer[32];
	char trans[127];
	uint8_t extra = (target == DBUS_MID_PC_TI92) ? 0 : ((vartype == TI89_BKUP) ? 0 : 1);
	uint16_t len;

	VALIDATE_HANDLE(handle);
	VALIDATE_NONNULL(varname);

	len = (uint16_t)strlen(varname);
	if (len > 17)
	{
		ticalcs_critical("Oversized variable name has length %i, clamping to 17", len);
		len = 17;
	}

	ticonv_varname_to_utf8_sn(handle->model, varname, trans, sizeof(trans), vartype);

	buffer[0] = LSB(LSW(varsize));
	buffer[1] = MSB(LSW(varsize));
	buffer[2] = LSB(MSW(varsize));
	buffer[3] = MSB(MSW(varsize));
	buffer[4] = vartype;
	buffer[5] = len;
	memcpy(buffer + 6, varname, len);
	buffer[6 + len] = 0x03;

	ticalcs_info(" PC->TI: VAR (size=0x%08X=%i, id=%02X, name=%s)", varsize, varsize, vartype, trans);
	return dbus_send(handle, target, DBUS_CMD_VAR, 6 + len + extra, buffer);
}
开发者ID:TC01,项目名称:tilibs,代码行数:31,代码来源:cmd68k.c


示例14: ti68k_send_simple_cmd

static inline int ti68k_send_simple_cmd(CalcHandle * handle, uint8_t target, uint8_t cmd, const char * cmdname, uint16_t length, const uint8_t* data)
{
	VALIDATE_HANDLE(handle);

	ticalcs_info(" PC->TI: %s", cmdname);
	return dbus_send(handle, target, cmd, length, data);
}
开发者ID:TC01,项目名称:tilibs,代码行数:7,代码来源:cmd68k.c


示例15: ti89_send_DEL

TIEXPORT3 int TICALL ti89_send_DEL(CalcHandle* handle, uint32_t varsize, uint8_t vartype, const char *varname)
{
	uint8_t buffer[32];
	uint16_t len;

	VALIDATE_HANDLE(handle);
	VALIDATE_NONNULL(varname);
	len = (uint16_t)strlen(varname);
	if (len > 17)
	{
		ticalcs_critical("Oversized variable name has length %i, clamping to 17", len);
		len = 17;
	}

	buffer[0] = 0;
	buffer[1] = 0;
	buffer[2] = 0;
	buffer[3] = 0;
	buffer[4] = 0;
	buffer[5] = len;
	memcpy(buffer + 6, varname, len);

	ticalcs_info(" PC->TI: DEL (size=0x%08X=%i, id=%02X, name=%s)", varsize, varsize, vartype, varname);
	return dbus_send(handle, ti68k_handle_to_dbus_mid(handle), DBUS_CMD_DEL, 6 + len, buffer);
}
开发者ID:TC01,项目名称:tilibs,代码行数:25,代码来源:cmd68k.c


示例16: ti92_send_RTS

TIEXPORT3 int TICALL ti92_send_RTS(CalcHandle* handle, uint32_t varsize, uint8_t vartype, const char *varname)
{
	uint8_t buffer[32];
	uint16_t len;

	VALIDATE_HANDLE(handle);
	VALIDATE_NONNULL(varname);
	len = (uint16_t)strlen(varname);
	if (len > 17)
	{
		ticalcs_critical("Oversized variable name has length %i, clamping to 17", len);
		len = 17;
	}

	buffer[0] = LSB(LSW(varsize));
	buffer[1] = MSB(LSW(varsize));
	buffer[2] = LSB(MSW(varsize));
	buffer[3] = MSB(MSW(varsize));
	buffer[4] = vartype;
	buffer[5] = len;
	memcpy(buffer + 6, varname, len);

	ticalcs_info(" PC->TI: RTS (size=0x%08X=%i, id=%02X, name=%s)", varsize, varsize, vartype, varname);
	return dbus_send(handle, DBUS_MID_PC_TI92, DBUS_CMD_RTS, 6 + len, buffer);
}
开发者ID:TC01,项目名称:tilibs,代码行数:25,代码来源:cmd68k.c


示例17: ti73_send_DEL

TIEXPORT3 int TICALL ti73_send_DEL(CalcHandle* handle, uint16_t varsize, uint8_t vartype, const char *varname, uint8_t varattr)
{
	uint8_t buffer[16] = { 0 };
	char trans[9];

	if (handle == NULL)
	{
		ticalcs_critical("%s: handle is NULL", __FUNCTION__);
		return ERR_INVALID_HANDLE;
	}
	if (varname == NULL)
	{
		ticalcs_critical("%s: varname is NULL", __FUNCTION__);
		return ERR_INVALID_PACKET;
	}

	buffer[0] = LSB(varsize);
	buffer[1] = MSB(varsize);
	buffer[2] = vartype == TI83p_APPL ? 0x14 : vartype;
	memcpy(buffer + 3, varname, 8);
	pad_buffer_to_8_chars(buffer + 3, '\0');
	buffer[11] = 0x00;

	ticonv_varname_to_utf8_s(handle->model, varname, trans, vartype);
	ticalcs_info(" PC->TI: DEL (name=%s)", trans);

	return dbus_send(handle, PC_TI7383, CMD_DEL, 11, buffer);
}
开发者ID:debrouxl,项目名称:tilp-libticalcs,代码行数:28,代码来源:cmd73.c


示例18: ti89_send_CNT_h

int ti89_send_CNT_h(CalcHandle* handle)
{
    ticalcs_info(" PC->TI: CNT");
    TRYF(dbus_send(handle, PC_TI9X, CMD_CNT, 2, NULL));

    return 0;
}
开发者ID:tobiasBora,项目名称:emacs_ti,代码行数:7,代码来源:cmd89.c


示例19: ti82_send_ACK_h

int ti82_send_ACK_h(CalcHandle* handle)
{
  ticalcs_info(" PC->TI: ACK");
  TRYF(dbus_send(handle, PC_TI8283, CMD_ACK, 2, NULL));

  return 0;
}
开发者ID:TI8XEmulator,项目名称:graph89,代码行数:7,代码来源:cmd82.c


示例20: ti89_send_RDY_h

int ti89_send_RDY_h(CalcHandle* handle)
{
    ticalcs_info(" PC->TI: RDY?");
    TRYF(dbus_send(handle, PC_TI9X, CMD_RDY, 2, NULL));

    return 0;
}
开发者ID:tobiasBora,项目名称:emacs_ti,代码行数:7,代码来源:cmd89.c



注:本文中的dbus_send函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ dbus_set_error_from_message函数代码示例发布时间:2022-05-30
下一篇:
C++ dbus_pending_call_unref函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap