RingMiddlewareApi.js 641 B

12345678910111213141516171819202122232425262728293031323334
  1. if(typeof(plugin) == "undefined"){
  2. var plugin = {};
  3. }
  4. plugin.ringMiddleware = {};
  5. /**
  6. * 启动
  7. */
  8. plugin.ringMiddleware.start = function(){
  9. if(typeof(RING_MIDDLEWARE) == "undefined"){
  10. alert("设备不支持指环王。");
  11. }else{
  12. RING_MIDDLEWARE.start();
  13. }
  14. };
  15. /**
  16. * 停止
  17. */
  18. plugin.ringMiddleware.stop = function(){
  19. if(typeof(RING_MIDDLEWARE) == "undefined"){
  20. alert("设备不支持指环王。");
  21. }else{
  22. RING_MIDDLEWARE.stop();
  23. }
  24. };
  25. /**
  26. * 读取事件,js中需要覆盖该事件
  27. */
  28. plugin.ringMiddleware.scanEvent = function (barCode){
  29. alert("读取到条码:" + barCode);
  30. }