BroadbandForum / obuspa

OB-USP-AGENT is a system daemon providing a User Services Platform (USP) Agent. https://github.com/BroadbandForum/obuspa/wiki
BSD 3-Clause "New" or "Revised" License
93 stars 62 forks source link

Reboot() operation on Agent not working. #85

Closed M0ulinamary closed 1 year ago

M0ulinamary commented 1 year ago

I have done setup of USP Agent in Server A. And done test controller setup in Server B.

All other Get/Set/GetDm commands are working. When i issue the Reboot command, I could see that the request reached to Agent, And response says "Controller initiated reboot". And then the running Agent console stopped, No restart happened .

Can you help to debug on why the stop happening, and Start is not taking place ? How to test the reboot completely with Agent (Controller initiated Reboot) ?

Actual result in Agent: Request: header { msg_id: "101" msg_type: OPERATE } body { request { operate { command: "Device.Reboot()" command_key: "boot123" send_resp: true } } }

Response: header { msg_id: "101" msg_type: OPERATE_RESP } body { response { operate_resp { operation_results { executed_command: "Device.Reboot()" req_output_args { } } } } }

Disconnecting from (host=agent.com, port=61613) Performing Controller initiated Reboot.

Stop happened, No start is happening. Please help here.

anderewrey commented 1 year ago

Hello,

You have to implement your "Reboot" handling in your own vendor file. Once you wrote your own "Reboot" function, you have to give its callback to obuspa.

  vendor_hook_cb_t vendor_hook_cb;
  vendor_hook_cb.reboot_cb = Reboot;
  vendor_hook_cb.factory_reset_cb = FactoryReset;
  usp_err = USP_REGISTER_CoreVendorHooks(&vendor_hook_cb);

where both Reboot and FactoryReset are function names.

See https://github.com/BroadbandForum/obuspa/blob/master/src/include/usp_api.h#L260

holme-r commented 1 year ago

Also see https://github.com/BroadbandForum/obuspa/blob/master/QUICK_START_GUIDE.md#overriding-the-core-implementation

johnblackford commented 1 year ago

Question Answered - please re-open if this is still an issue