MCPcopy Create free account
hub / github.com/RT-Thread/rt-thread / rtlink_fselect

Function rtlink_fselect

examples/rt-link/rtlink_dev_example.c:179–210  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

177}
178
179static void rtlink_fselect()
180{
181 /* step1: register rtlink to to the device framework */
182 rt_link_dev_register(&rtlink_fd, RTLINK02,
183 RT_DEVICE_FLAG_RDWR |
184 RT_DEVICE_FLAG_REMOVABLE |
185 RT_DEVICE_FLAG_STANDALONE,
186 RT_NULL);
187
188 /* step2: Initialize the rlink device as the default configuration, */
189 rt_device_t device = rt_device_find(RTLINK02);
190 if (device == RT_NULL)
191 {
192 LOG_E("device not find!");
193 return ;
194 }
195 rt_device_init(device);
196
197 /* step3: config rtlink device rx/tx callback, channel, send timeout */
198 rt_device_set_rx_indicate(device, rtlink_dev_rx_ind);
199 rt_device_set_tx_complete(device, rtlink_dev_tx_done);
200 struct rt_link_service service;
201 service.service = RT_LINK_SERVICE_MNGT;
202 service.timeout_tx = RT_WAITING_NO;
203 rt_device_control(device, RT_DEVICE_CTRL_CONFIG, &service);
204
205 rt_thread_t tid = rt_thread_create(RTLINK02, listen_thread, RT_NULL, 1024, 21, 20);
206 if (tid)
207 {
208 rt_thread_startup(tid);
209 }
210}
211MSH_CMD_EXPORT(rtlink_fselect, rtlink posix interface example);
212#endif /* RT_USING_POSIX_DEVIO */
213

Callers

nothing calls this directly

Calls 8

rt_link_dev_registerFunction · 0.85
rt_device_findFunction · 0.85
rt_device_initFunction · 0.85
rt_device_controlFunction · 0.85
rt_thread_createFunction · 0.85
rt_thread_startupFunction · 0.85

Tested by

no test coverage detected