commands-dms.h 4.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. /*
  2. * uqmi -- tiny QMI support implementation
  3. *
  4. * Copyright (C) 2014-2015 Felix Fietkau <nbd@openwrt.org>
  5. *
  6. * This library is free software; you can redistribute it and/or
  7. * modify it under the terms of the GNU Lesser General Public
  8. * License as published by the Free Software Foundation; either
  9. * version 2 of the License, or (at your option) any later version.
  10. *
  11. * This library is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  14. * Lesser General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU Lesser General Public
  17. * License along with this library; if not, write to the
  18. * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
  19. * Boston, MA 02110-1301 USA.
  20. */
  21. #define __uqmi_dms_commands \
  22. __uqmi_command(dms_get_capabilities, get-capabilities, no, QMI_SERVICE_DMS), \
  23. __uqmi_command(dms_get_pin_status, get-pin-status, no, QMI_SERVICE_DMS), \
  24. __uqmi_command(dms_verify_pin1, verify-pin1, required, QMI_SERVICE_DMS), \
  25. __uqmi_command(dms_verify_pin2, verify-pin2, required, QMI_SERVICE_DMS), \
  26. __uqmi_command(dms_set_pin1_protection, set-pin1-protection, required, QMI_SERVICE_DMS), \
  27. __uqmi_command(dms_set_pin2_protection, set-pin2-protection, required, QMI_SERVICE_DMS), \
  28. __uqmi_command(dms_set_pin, pin, required, CMD_TYPE_OPTION), \
  29. __uqmi_command(dms_change_pin1, change-pin1, no, QMI_SERVICE_DMS), \
  30. __uqmi_command(dms_change_pin2, change-pin2, no, QMI_SERVICE_DMS), \
  31. __uqmi_command(dms_unblock_pin1, unblock-pin1, no, QMI_SERVICE_DMS), \
  32. __uqmi_command(dms_unblock_pin2, unblock-pin2, no, QMI_SERVICE_DMS), \
  33. __uqmi_command(dms_set_puk, puk, required, CMD_TYPE_OPTION), \
  34. __uqmi_command(dms_set_new_pin, new-pin, required, CMD_TYPE_OPTION), \
  35. __uqmi_command(dms_get_iccid, get-iccid, no, QMI_SERVICE_DMS), \
  36. __uqmi_command(dms_get_imsi, get-imsi, no, QMI_SERVICE_DMS), \
  37. __uqmi_command(dms_get_imei, get-imei, no, QMI_SERVICE_DMS), \
  38. __uqmi_command(dms_get_msisdn, get-msisdn, no, QMI_SERVICE_DMS), \
  39. __uqmi_command(dms_set_operating_mode, set-device-operating-mode, required, QMI_SERVICE_DMS), \
  40. __uqmi_command(dms_reset, reset-dms, no, QMI_SERVICE_DMS), \
  41. __uqmi_command(dms_set_fcc_authentication, fcc-auth, no, QMI_SERVICE_DMS) \
  42. #define dms_helptext \
  43. " --get-capabilities: List device capabilities\n" \
  44. " --get-pin-status: Get PIN verification status\n" \
  45. " --verify-pin1 <pin>: Verify PIN1\n" \
  46. " --verify-pin2 <pin>: Verify PIN2\n" \
  47. " --set-pin1-protection <state>: Set PIN1 protection state (disabled, enabled)\n" \
  48. " --pin <pin>: PIN1 needed to change state\n" \
  49. " --set-pin2-protection <state>: Set PIN2 protection state (disabled, enabled)\n" \
  50. " --pin <pin2>: PIN2 needed to change state\n" \
  51. " --change-pin1: Change PIN1\n" \
  52. " --pin <old pin>: Current PIN1\n" \
  53. " --new-pin <new pin>: New pin\n" \
  54. " --change-pin2: Change PIN2\n" \
  55. " --pin <old pin>: Current PIN2\n" \
  56. " --new-pin <new pin>: New pin\n" \
  57. " --unblock-pin1: Unblock PIN1\n" \
  58. " --puk <puk>: PUK needed to unblock\n" \
  59. " --new-pin <new pin>: New pin\n" \
  60. " --unblock-pin2: Unblock PIN2\n" \
  61. " --puk <puk>: PUK needed to unblock\n" \
  62. " --new-pin <new pin>: New pin\n" \
  63. " --get-iccid: Get the ICCID\n" \
  64. " --get-imsi: Get International Mobile Subscriber ID\n" \
  65. " --get-imei: Get International Mobile Equipment ID\n" \
  66. " --get-msisdn: Get the MSISDN (telephone number)\n" \
  67. " --reset-dms: Reset the DMS service\n" \
  68. " --set-device-operating-mode <m> Set the device operating mode\n" \
  69. " (modes: online, low_power, factory_test, offline\n" \
  70. " reset, shutting_down, persistent_low_power,\n" \
  71. " mode_only_low_power)\n" \
  72. " --fcc-auth: Set FCC authentication\n" \
  73. const char *get_pin_status(int status);