TAPI General Programming Considerations

不知道该怎么翻译合适,不过内容很象我设计架构时的一些规范和约束. 姑且译为 TAPI 程序设计约定.

一 telephony operation分为异步和同步:
1)异步操作将一个DRV_REQUEST类型dwRequestID作为第一个参数.当操作执行时,可以在函数调用中执行一部分操作,函数返回后可以在另外一个线程中执行其余的操作.操作函数将返回一个负错误码或者正dwRequestID.
当操作最终完成时,执行线程调用ASYNC_COMPLETION,返回REQUEST ID和错误码.
这句话不明白:Service providers should always copy input data from application memory into service provider memory before returning from an asynchronous function.
2)同步操作不需要dwRequestID,也不需要调用ASYNC_COMPLETION
 
NOTE:If the operation completes very rapidly (or the original request returns very slowly), it is possible that the interrupt handler that runs when a physical operation completes may be triggered before the original request returns to the application or even to TAPI. This behavior is allowed. TAPI guarantees that the eventual completion notification to the application is delivered after the original request returns.
 
二 Memory Alloc
在TAPI 函数调用中
App负责分配传递信息所需的内存,TAPI仅仅是填写这些信息.
dwTotalSize指示数据结构总的大小,由调用APP赋值。
dwNeededSize指示需要多少字节来容纳返回的信息,由被TAPI赋值。
dwUserSize指示实际使用的字节数,由TAPI填写
 
当调用数据结构参数中存在可变尺寸信息时,如果dwTotalSize小于数据结构固定header大小,那么,将返回LINEERR/ PHONEERR_STRUCTURETOOSMALL.
 
 
Note: All text strings, regardless of encoding, in variably sized structures should be NULL-terminated according to normal C string-handling conventions.
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值