在文档中,我们有以下命令。
command mergAccessoryRead pNameAndProtocol,pLength,pCallcackHandler
command mergAccessoryWrite pNameAndProtocol,pData,pCallcackHandler
它们仅适用于打印机还是可以普遍使用?例子?
更新 2:我被困在 mergAccessoryOpenSession 上。我认为在这个案例上没有开过任何会议。
这是我当前的代码。
global pNameAndProtocol
global pData
on preopenstack
put "xxxx" into pNameAndProtocol
put "get xxxx" into pData
end preopenstack
command xxxx
answer pNameAndProtocol
answer pData
printDocket
end xxxx
on printDocket
try
mergAccessoryOpenSession "xxxx","sessionOpen"
answer "mergAccessoryOpenSession is called..."
catch someError
answer "An error on printDocket " &&someError
end try
end printDocket
on sessionOpen pNameAndProtocol
try
mergAccessoryWrite "xxxx","get xxxx","writeCompleted"
answer "mergAccessoryWrite is called..."
catch someError
answer "An error on sessionOpen " &&someError
end try
end sessionOpen
on writeCompleted pNameAndProtocol
try
mergAccessoryRead pNameAndProtocol,0,"readCompleted"
answer "mergAccessoryRead is called..."
catch someError
answer "An error on writeCompleted " &&someError
end try
end writeCompleted
on readCompleted pNameAndProtocol,pData
answer "Completed..."
end readCompleted