Forums | developer.brewmp.com Forums | developer.brewmp.com

Developer

Forums

Forums:

It is extreemly irritating and delaying and time consuming when the official documentation for canonical code from Qualcomm is absolutely riddled with bugs and typos (just try compiling it verbatum to see what I mean) and also doesn't work.

 

I'm using the code for the UDP client on page 26 onwards from here:

 

https://developer.brewmp.com/resources/tech-guides/dns-multicast-qos-ssl-tcpip-technology-guide/basic-data-networking

 

Here's the code, changed to remove typos and using the loopback address instead of that given in the example (although that's irrelevant as we don't get to the point to be able to send data). The applet has the AEEPRIVID_PLNetwork privilege.

The code results in an exception in the call to ISockPort_OpenEx. The previous call to CreateInstance() returns 0.

 

So my question, obviously, is why is there an exception? What is wrong with the code? Its only a few lines long.

// initialize the addresses
pMe->m_saSockAddr.wFamily = AEE_AF_INET; 
pMe->m_saSockAddr.inet.port = HTONS(21); 
INET_PTON(pMe->m_saSockAddr.wFamily, "127.0.0.1", &(pMe->m_saSockAddr.inet.addr));

// create the ISockPort object.
ret = ISHELL_CreateInstance(pMe->m_pIShell, AEEIID_ISockPort, (void**)&(pMe->m_pISockPort));

// open the SockPort.
ret = ISockPort_OpenEx(pMe->m_pISockPort, AEE_AF_INET, AEE_SOCKPORT_DGRAM, 0);

 

Crash may be bcoz of the use of AEEIID_ISockPort to create instance in the code you posted. You should use AEECLSID_SOCKPORT (in AEESockPort.bid) as below.
ISHELL_CreateInstance(pme->m_pIShell, AEECLSID_SOCKPORT, (void**)&(pme->m_pISockPort));the same is directed in the sample of "basic-data-networking".

Crash may be bcoz of the use of AEEIID_ISockPort to create instance in the code you posted. You should use AEECLSID_SOCKPORT (in AEESockPort.bid) as below.
ISHELL_CreateInstance(pme->m_pIShell, AEECLSID_SOCKPORT, (void**)&(pme->m_pISockPort));the same is directed in the sample of "basic-data-networking".

Thanks.
 
Though there is no AEECLSID_SOCKPORT, but there is AEECLSID_SockPort. 
Which is my point - if you copy and paste that example code there are many instances of typos, name-mismatches, using defines that aren't defined etc. etc. Which therefore forces a beginner to experiment in an attempt to get it to compile. Code examples in documents should at least compile.
 
 

Thanks.
 
Though there is no AEECLSID_SOCKPORT, but there is AEECLSID_SockPort. 
Which is my point - if you copy and paste that example code there are many instances of typos, name-mismatches, using defines that aren't defined etc. etc. Which therefore forces a beginner to experiment in an attempt to get it to compile. Code examples in documents should at least compile.