antsBleApi.js 722 B

1234567891011121314151617181920
  1. var bleApi = require('baseBleApi.js');
  2. module.exports = {
  3. sendCommand: sendCommand
  4. }
  5. function sendCommand(params) {
  6. var defaults = {
  7. adviceId: "",
  8. sendCommend: "",
  9. onSuccessCallBack: function successCallBack(res) {},
  10. onFailCallBack: function failCallBack(res) {},
  11. onCompleteCallBack: function completeCallBack(res) {},
  12. services: ["xxxxx-xxxxxxxxx-xxxxx"],
  13. writeServiceUUID: "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
  14. notifyServiceUUID: "xxxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxx",
  15. notifyCharacteristicUUID: "xxxxxxxxxx-xxxxx-xxxx-xxxx-xxxxxxxx",
  16. writeCharacteristicUUID: "xxxx-xxxx-xxxx-xxxx-xxxx"
  17. }
  18. var setParams = Object.assign(defaults, params)
  19. bleApi.writeCommend(setParams);
  20. }