Forum Discussion

covfefe's avatar
covfefe
Icon for Occasional Contributor rankOccasional Contributor
3 years ago

system-console, close_service not working?

Hello,

I am trying to close_service & claim_service (to handle disconnected devices).

Unfortunately I am unable to make it work.

  1. How can I close_service pathA, then claim_service pathA ?
  2. Or, alternatively close all service paths, to keep the service console, but start fresh?
close_service master {%s}; claim_service master {%s} m

Response:

CLIENT (sock2532): close_service master {/devices/5AGT(FD3H3|MD3G3)|5AGXBB3D4|..@1#USB-1/(link)/JTAG/(110:132 v1 #0)/phy_0/master}; claim_service master {/devices/5AGT(FD3H3|MD3G3)|5AGXBB3D4|..@1#USB-1/(link)/JTAG/(110:132 v1 #0)/phy_0/master} m
SERVER (sock2532): Invalid command from the client
ErrorMsg : Could not claim service at /devices/5AGT(FD3H3|MD3G3)|5AGXBB3D4|..@1#USB-1/(link)/JTAG/(110:132 v1 #0)/phy_0/master: Channel is opened
    while executing
"claim_service {master} {/devices/5AGT(FD3H3|MD3G3)|5AGXBB3D4|..@1#USB-1/(link)/JTAG/(110:132 v1 #0)/phy_0/master} {m}"
ErrorCode: NONE
ErrorInfo:
Could not claim service at /devices/5AGT(FD3H3|MD3G3)|5AGXBB3D4|..@1#USB-1/(link)/JTAG/(110:132 v1 #0)/phy_0/master: Channel is opened
    while executing
"claim_service {master} {/devices/5AGT(FD3H3|MD3G3)|5AGXBB3D4|..@1#USB-1/(link)/JTAG/(110:132 v1 #0)/phy_0/master} {m}"
    while executing
"claim_service master {/devices/5AGT(FD3H3|MD3G3)|5AGXBB3D4|..@1#USB-1/(link)/JTAG/(110:132 v1 #0)/phy_0/master} m"
    ("eval" body line 1)

11 Replies

  • sstrell's avatar
    sstrell
    Icon for Super Contributor rankSuper Contributor

    close_service has to point to the claim path, not the service path (in your case, the master service path).

    claim_service will point to the master service path.

  • sstrell's avatar
    sstrell
    Icon for Super Contributor rankSuper Contributor

    No, it looks like you are using the master service path for both close_service and claim_service. A claim path is usually created like this in a script after you've created the service path (mpath in this case):

    set claim_path [claim_service master $mpath {} {}]

    So then close_service can simply be:

    close_service master $claim_path

  • covfefe's avatar
    covfefe
    Icon for Occasional Contributor rankOccasional Contributor

    Thank you. Right now, if I try to

    claim_service master {/devices/5AGT(FD3H3|MD3G3)|5AGXBB3D4|..@1#USB-1/(link)/JTAG/(110:132 v1 #0)/phy_0/master} m

    and the channel is open, I get an error message. How can I bypass this issue, without knowing the claim path? I assume I first need to close the channel, then do claim_service.

    An attempt at

    is_service_open master {/devices/5AGT(FD3H3|MD3G3)|5AGXBB3D4|..@1#USB-1/(link)/JTAG/(110:132 v1 #0)/phy_0/master}

    does not work, and returns 0 regardless.

    An attempt at

    get_claimed_services master;

    returns no values.

    set claim_path [claim_service master {/devices/5AGT(FD3H3|MD3G3)|5AGXBB3D4|..@1#USB-1/(link)/JTAG/(110:132 v1 #0)/phy_0/master} {} {}]

    crashes by saying could not claim service, channel is open

  • sstrell's avatar
    sstrell
    Icon for Super Contributor rankSuper Contributor

    So you've done claim_service previously but you don't know what the claim path was?

    What if you just write the whole thing out:

    close_service master [claim_service master {/devices/5AGT(FD3H3|MD3G3)|5AGXBB3D4|..@1#USB-1/(link)/JTAG/(110:132 v1 #0)/phy_0/master} m]

    • covfefe's avatar
      covfefe
      Icon for Occasional Contributor rankOccasional Contributor

      This does not work.

      As the previous message says, this command crashes

      close_service master [claim_service master {/devices/5AGT(FD3H3|MD3G3)|5AGXBB3D4|..@1#USB-1/(link)/JTAG/(110:132 v1 #0)/phy_0/master} m]
      
      CLIENT (sock2472): claim_service master {/devices/5AGT(FD3H3|MD3G3)|5AGXBB3D4|..@1#USB-1/(link)/JTAG/(110:132 v1 #0)/phy_0/master} m
      SERVER (sock2472): Invalid command from the client
      ErrorMsg : Could not claim service at /devices/5AGT(FD3H3|MD3G3)|5AGXBB3D4|..@1#USB-1/(link)/JTAG/(110:132 v1 #0)/phy_0/master: Channel is opened

      so the following command as well

      CLIENT (sock2472): close_service master [claim_service master {/devices/5AGT(FD3H3|MD3G3)|5AGXBB3D4|..@1#USB-1/(link)/JTAG/(110:132 v1 #0)/phy_0/master} m]
      
      SERVER (sock2472): Invalid command from the client
      ErrorMsg : Could not claim service at /devices/5AGT(FD3H3|MD3G3)|5AGXBB3D4|..@1#USB-1/(link)/JTAG/(110:132 v1 #0)/phy_0/master: Channel is opened

      Yes, claim_path is unknown (application reboot)

  • ShengN_altera's avatar
    ShengN_altera
    Icon for Super Contributor rankSuper Contributor

    Hi,


    Or may be try to get service path first like below:

    set m_path [lindex [get_service_paths master] 0 ]

    set c_path [claim_service master $m_path ""]

    close_service master $c_path


    Best Regards,

    Sheng

    p/s: If any answer from community or Intel support are helpful, please feel free to mark as solution and give Kudos.


  • ShengN_altera's avatar
    ShengN_altera
    Icon for Super Contributor rankSuper Contributor

    Since there are no further updates or concerns for this thread, I shall set this thread to close pending. If you still need further assistance, you are welcome reopen this thread within 20days or open a new thread, some one will be right with you.


  • covfefe's avatar
    covfefe
    Icon for Occasional Contributor rankOccasional Contributor

    Thank you, the following successfully closes the service path:

    set m_path [lindex [get_service_paths master] 0 ];
    set c_path [claim_service master $m_path ""];
    close_service master $c_path;

    Now, to be able to re-claim an existing path, I first need to be able to check if it is closed. However, this command returns 0 regardless of the status (open or closed).

    is_service_open master {/devices/5AGT(FD3H3|MD3G3)|5AGXBB3D4|..@1#USB-1/(link)/JTAG/(110:132 v1 #0)/phy_0/master}

    Which then errors on the next command to claim it

    claim_service master {/devices/5AGT(FD3H3|MD3G3)|5AGXBB3D4|..@1#USB-1/(link)/JTAG/(110:132 v1 #0)/phy_0/master} m
    
    CLIENT (sock2256): claim_service master {/devices/5AGT(FD3H3|MD3G3)|5AGXBB3D4|..@1#USB-1/(link)/JTAG/(110:132 v1 #0)/phy_0/master} m
    SERVER (sock2256): Invalid command from the client
    ErrorMsg : Could not claim service at /devices/5AGT(FD3H3|MD3G3)|5AGXBB3D4|..@1#USB-1/(link)/JTAG/(110:132 v1 #0)/phy_0/master: Channel is opened

    Is it possible "close_service master" does not really close it?

    • ShengN_altera's avatar
      ShengN_altera
      Icon for Super Contributor rankSuper Contributor

      Hi,

      After close_service, you have to get_service again in order to claim_service. claim_service can't be done straight away after closing service.


      Best regards,
      Sheng

      p/s: If any answer from community or Intel support are helpful, please feel free to mark as solution and give Kudos.