对服务进行编码以从外部设备读取消息 [英] Coding a service to read messages from an external device

查看:63
本文介绍了对服务进行编码以从外部设备读取消息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您将如何编码服务以侦听来自外部设备的消息?

How would you code a service to listen for message from an external device?

推荐答案

使用计时器.在每个刻度上,检查是否有任何数据传入设备的缓冲区.处理传入的数据.最好参考设备说明或SDK以获得预期的数据格式.

如果您正在寻找更多细节,则需要提供更多详细信息.
Use a timer. On each tick check to see if there is any data incoming in the buffer for the device. Process the incoming data. It''s best to reference the device instructions or SDK for expected data formats.

If you are looking for more specifics, you''ll need to provide more details.


您给我们的信息太少了,我们可能无法给您任何建议.
You''ve given us so little info that we can''t possibly give you any advice.


这篇关于对服务进行编码以从外部设备读取消息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆