Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API Client #349

Open
gesaleh opened this issue Mar 6, 2017 · 0 comments
Open

API Client #349

gesaleh opened this issue Mar 6, 2017 · 0 comments

Comments

@gesaleh
Copy link

gesaleh commented Mar 6, 2017

Hi
Client API is missing connection to the server
when i do this the sessionId is missing in the request
I used the server.api to connect and retreive the sessionID then the request Set and Get works

import api
import ipc
import ipc_lwm2m_client as client


ipcPort=12345
server_api = api.ServerAPI("127.0.0.1", ipcPort)
sessionId=server_api.GetSessionId()
print (sessionId)

def sendRequest(ipcChannel, requestType, responseType, path, value , sessionId):
    request = requestType(session_id=sessionId)
    request.add(path, value)
    print(request.serialize())
    response_xml = ipc.send_request_and_receive_response(ipcChannel, request.serialize())
    print(response_xml)
    #response = responseType(response_xml)
    return response



resp=sendRequest('udp://127.0.0.1:12345',client.SetRequest,client.SetResponse,(3001, 0, 0), 20.5 , sessionId)
print(resp)

but i keep getting segmentation fault
at the end of the execution and it is related to the server api part

is the API going to be updated for the client ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant