1 封装函数
1.1 Ohsce_eng_socket_X
1.1.1 Ohsce_eng_socket_client
1.1.2 Ohsce_eng_socket_client_setspace
1.1.3 Ohsce_eng_socket_server
1.1.3.1 Ohsce_eng_socket_server
1.1.3.2 callback
1.1.3.3 callbackaccept
1.1.3.4 fap
1.1.4 Ohsce_eng_socket_send
1.1.5 oibc_sce_socket_recv
1.1.6 Ohsce_eng_socket_server_runtcp
1.1.7 Ohsce_eng_socket_server_runudp
1.1.8 Ohsce_eng_socket_server_close
1.1.9 ohsce_eng_socket_reConnect
1.2 Ohsce_eng_serial_X
1.2.1 Ohsce_eng_serial_creat
1.2.2 Ohsce_eng_serial_setspace
1.2.3 Ohsce_eng_serial_open
1.2.4 Ohsce_eng_serial_write
1.2.5 Ohsce_eng_serial_read
1.2.6 Ohsce_eng_serial_comwr
1.2.7 Ohsce_eng_serial_npcomwr
1.2.8 Ohsce_eng_serial_close
1.3 Ohsce_channel_X
1.3.1 ohsce_channel_server_creat
1.3.2 ohsce_channel_client_creat
1.3.3 ohsce_channel_read
1.3.4 ohsce_channel_write
1.3.5 ohsce_reChannel
1.4 Ohsce_eng_url_X
1.4.1 Ohsce_eng_url_c
1.5 Ohsce_eng_sm_X
1.5.1 Ohsce_eng_sm_creat
1.5.2 Ohsce_eng_sm_open
1.5.3 Ohsce_eng_sm_write
1.5.4 Ohsce_eng_sm_read
1.5.5 Ohsce_eng_sm_close
1.6 Ohsce_OTHERS
1.6.1 Ohsce_base_iota
1.6.2 Ohsce_base_iota_set
2 基础函数
2.1 Ohsce_getos
2.2 ohsce_mcrypt
2.3 Ohsce_createSocket
2.4 Ohsce_geterror
2.5 Ohsce_socketconnect
2.6 Ohsce_socketclose
2.7 Ohsce_socketstop
2.8 Ohsce_socketbind
2.9 Ohsce_socketsetbuff
2.10 Ohsce_fastpush
2.11 Ohsce_socketlisten
2.12 Ohsce_getflags
2.13 Ohsce_socketsend
2.14 Ohsce_socketwrite
2.15 Ohsce_socketrecv
2.16 Ohsce_socketrecvfrom
2.17 Ohsce_socketread
2.18 Ohsce_casepr
2.19 Ohsce_comparity
2.20 Ohsce_comfc
2.21 Ohsce_comset
2.22 Ohsce_comecase
2.23 Ohsce_comopen
2.24 Ohsce_comread
2.25 Ohsce_comwrite
2.26 Ohsce_comwriteread_np
2.27 Ohsce_ReadCom
2.28 Ohsce_fastflush
2.29 Ohsce_getbaud
2.30 Ohsce_comclose
2.31 Ohsce_ccom
2.32 Ohsce_exec
2.33 ohsce_smCreat
2.34 ohsce_smDecode
2.35 ohsce_smEncode
2.36 ohsce_smWrite
2.37 ohsce_smRead
2.38 ohsce_smClose
2.39 ohsce_smDelete
2.40 ohsce_smClean
2.41 ohsce_comflush
2.42 Ohsce_makearp
2.43 Ohsce_url_c
2.44 Ohsce_url_cp
2.45 Ohsce_url_seturl
2.46 Ohsce_url_setmode
2.47 Ohsce_url_setpos
2.48 Ohsce_url_setjson
2.49 Ohsce_url_setcookie
2.50 Ohsce_url_setproxy
2.51 Ohsce_url_setftp
2.52 Ohsce_url_exec
2.53 Ohsce_url_close
2.54 ohsce_jsonrpc_client_creat
2.55 ohsce_jsonrpc_format_response
2.56 ohsce_jsonrpc_request

Ohsce_eng_serial_comwr

2016-09-02 16:24:07
admin
3401
最后编辑:admin 于 2016-12-15 09:24:07
简介:向一个已打开的OHSCESerial资源所指定的串口写入数据紧接着并读取返回数据

(OHSCE >=V0.1.9)-向一个已打开的OHSCESerial资源所指定的串口写入数据紧接着并读取返回数据

Ohsce_eng_serial_comwr(&$oibc,$wbuf,$wlen=null,&$rbuf,$rlen=2,$mode=0)


$ohsce  

    -待读取且已打开的OHSCESerial资源。

$wbuf

   -待写入数据

$wlen

   -待写入数据长度

$rbuf

   -待读取数据

$rlen

   -待读取数据长度

$mode

   -模式

Example:

<?php
Ohsce_eng_serial_comwr($oibc,$wbuf,null,&$rbuf,2,0);
echo strlen($rbuf,);


Notice:

阻塞模式下如果串口没有返回数据或未设置超时时间,该函数会导致一直阻塞直至默认时间。

Ohsce_eng_serial_npcomwr函数 能够开启一个新的进程完成此函数同样的事情。