This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

mdnsAdvertiser fails with error -67, what does it mean? Why description on socket API part?

Hi,

i do a call like this

mdnsAdvertiser(1, "Martin", 6);

but get a return value of -67. What does the error mean? Does it need more than a connected AP to be successful?

(BTW: Using SP 1.24, but same with older SP)

mdnsAdvertiser is described here:

http://software-dl.ti.com/ecs/simplelink/cc3000/public/doxygen_API/v1.11/html/d2/d21/group__socket__api.html

Why is it described in socket API part, even when it seems not to be socket related? Why not in general WLAN api?

> "Return: On success, zero is returned, return SOC_ERROR if socket was not opened successfully, or if an error occurred."

Again here is a socket mentioned, but no socket as input nor as return parameter. Error in description?

Best regards,

Martin

  • Can't answer most of your questions, but in host driver version 13 from swrc263b mdnsAdvertiser is the only function that passes a pointer to int instead of a pointer to long to SimpleLinkWaitEvent.  Seems odd.

    FWIW, I too get garbage return values (not -67, but a value that appears to depend on the deviceServiceName: 189 for CC3000).  The board then transmits an MDNS PTR record for CC3000._device-info._udp.local.  Subsequent invocations with mdnsEnabled set retransmit the original record regardless of changes to the passed deviceServiceName.

    Invocation with mdnsEnabled=0 returns zero and does not transmit.

    Subsequent invocations with mdnsEnabled=1 again return other values and transmit malformed MDNS packets.

    Peter

  • Hi Peter,

    I know the problem with int/long (see other posting for you which is pending till admin from TI approves it, perhaps because i have a URL inside or written to much postings...)

    -67 = 0xBD = 189

    I have seen the BD directly in SPI trace (received bytes), but thought i calculate a negative number, because other error from TI with CC3000 are also using negative numbers.

    So you seem to get the same error value than me, but sending something. This is interesting. I must check, if my CC3000 also sends something.

    Best regards,

    Martin

  • Hi Peter,

    also on my side the packet is sent out, even when an error is reported (SP 1.24). This is what Wireshark decodes on my sent packet:

    No.     Time        Source                Destination           Protocol Length Info
         57 24.901403   192.168.178.25        224.0.0.251           MDNS     249    Standard query response PTR Martin._device-info._udp.local PTR _device-info._udp.local TXT, cache flush SRV, cache flush 0 0 1234 target.local A, cache flush 192.168.178.25

    Frame 57: 249 bytes on wire (1992 bits), 249 bytes captured (1992 bits)
        Arrival Time: Sep 23, 2013 21:36:03.359296000 Mitteleuropäische Sommerzeit
        Epoch Time: 1379964963.359296000 seconds
        [Time delta from previous captured frame: 0.000257000 seconds]
        [Time delta from previous displayed frame: 0.000257000 seconds]
        [Time since reference or first frame: 24.901403000 seconds]
        Frame Number: 57
        Frame Length: 249 bytes (1992 bits)
        Capture Length: 249 bytes (1992 bits)
        [Frame is marked: False]
        [Frame is ignored: False]
        [Protocols in frame: wlan:llc:ip:udp:dns]
        [Coloring Rule Name: UDP]
        [Coloring Rule String: udp]
    IEEE 802.11 Data, Flags: ......F.
        Type/Subtype: Data (0x20)
        Frame Control: 0x0208 (Normal)
            Version: 0
            Type: Data frame (2)
            Subtype: 0
            Flags: 0x2
                .... ..10 = DS status: Frame from DS to a STA via AP(To DS: 0 From DS: 1) (0x02)
                .... .0.. = More Fragments: This is the last fragment
                .... 0... = Retry: Frame is not being retransmitted
                ...0 .... = PWR MGT: STA will stay up
                ..0. .... = More Data: No data buffered
                .0.. .... = Protected flag: Data is not protected
                0... .... = Order flag: Not strictly ordered
        Duration: 0
        Destination address: IPv4mcast_00:00:fb (01:00:5e:00:00:fb)
        BSS Id: Avm_da:0e:4d (24:65:11:da:0e:4d)
        Source address: TexasIns_01:8f:d5 (08:00:28:01:8f:d5)
        Fragment number: 0
        Sequence number: 3734
    Logical-Link Control
        DSAP: SNAP (0xaa)
        IG Bit: Individual
        SSAP: SNAP (0xaa)
        CR Bit: Command
        Control field: U, func=UI (0x03)
            000. 00.. = Command: Unnumbered Information (0x00)
            .... ..11 = Frame type: Unnumbered frame (0x03)
        Organization Code: Encapsulated Ethernet (0x000000)
        Type: IP (0x0800)
    Internet Protocol Version 4, Src: 192.168.178.25 (192.168.178.25), Dst: 224.0.0.251 (224.0.0.251)
        Version: 4
        Header length: 20 bytes
        Differentiated Services Field: 0x00 (DSCP 0x00: Default; ECN: 0x00: Not-ECT (Not ECN-Capable Transport))
            0000 00.. = Differentiated Services Codepoint: Default (0x00)
            .... ..00 = Explicit Congestion Notification: Not-ECT (Not ECN-Capable Transport) (0x00)
        Total Length: 217
        Identification: 0x0003 (3)
        Flags: 0x00
            0... .... = Reserved bit: Not set
            .0.. .... = Don't fragment: Not set
            ..0. .... = More fragments: Not set
        Fragment offset: 0
        Time to live: 1
            [Expert Info (Note/Sequence): "Time To Live" != 255 for a packet sent to the Local Network Control Block (see RFC 3171)]
                [Message: "Time To Live" != 255 for a packet sent to the Local Network Control Block (see RFC 3171)]
                [Severity level: Note]
                [Group: Sequence]
        Protocol: UDP (17)
        Header checksum: 0x6554 [correct]
            [Good: True]
            [Bad: False]
        Source: 192.168.178.25 (192.168.178.25)
        Destination: 224.0.0.251 (224.0.0.251)
    User Datagram Protocol, Src Port: easy-soft-mux (2168), Dst Port: mdns (5353)
        Source port: easy-soft-mux (2168)
        Destination port: mdns (5353)
        Length: 197
        Checksum: 0x696d [validation disabled]
            [Good Checksum: False]
            [Bad Checksum: False]
    Domain Name System (response)
        Transaction ID: 0x0000
        Flags: 0x8400 (Standard query response, No error)
            1... .... .... .... = Response: Message is a response
            .000 0... .... .... = Opcode: Standard query (0)
            .... .1.. .... .... = Authoritative: Server is an authority for domain
            .... ..0. .... .... = Truncated: Message is not truncated
            .... ...0 .... .... = Recursion desired: Don't do query recursively
            .... .... 0... .... = Recursion available: Server can't do recursive queries
            .... .... .0.. .... = Z: reserved (0)
            .... .... ..0. .... = Answer authenticated: Answer/authority portion was not authenticated by the server
            .... .... ...0 .... = Non-authenticated data: Unacceptable
            .... .... .... 0000 = Reply code: No error (0)
        Questions: 0
        Answer RRs: 5
        Authority RRs: 0
        Additional RRs: 0
        Answers
            _device-info._udp.local: type PTR, class IN, Martin._device-info._udp.local
                Name: _device-info._udp.local
                Type: PTR (Domain name pointer)
                .000 0000 0000 0001 = Class: IN (0x0001)
                0... .... .... .... = Cache flush: False
                Time to live: 1 hour, 15 minutes
                Data length: 9
                Domain name: Martin._device-info._udp.local
            _services._dns-sd._udp.local: type PTR, class IN, _device-info._udp.local
                Name: _services._dns-sd._udp.local
                Type: PTR (Domain name pointer)
                .000 0000 0000 0001 = Class: IN (0x0001)
                0... .... .... .... = Cache flush: False
                Time to live: 1 hour, 15 minutes
                Data length: 2
                Domain name: _device-info._udp.local
            Martin._device-info._udp.local: type TXT, class IN, cache flush
                Name: Martin._device-info._udp.local
                Type: TXT (Text strings)
                .000 0000 0000 0001 = Class: IN (0x0001)
                1... .... .... .... = Cache flush: True
                Time to live: 1 hour, 15 minutes
                Data length: 36
                Text: dev=CC3000
                Text: vendor=Texas-Instruments
            Martin._device-info._udp.local: type SRV, class IN, cache flush, priority 0, weight 0, port 1234, target target.local
                Service: artin
                Protocol: device-info
                Name: _udp.local
                Type: SRV (Service location)
                .000 0000 0000 0001 = Class: IN (0x0001)
                1... .... .... .... = Cache flush: True
                Time to live: 1 hour, 15 minutes
                Data length: 15
                Priority: 0
                Weight: 0
                Port: 1234
                Target: target.local
            target.local: type A, class IN, cache flush, addr 192.168.178.25
                Name: target.local
                Type: A (Host address)
                .000 0000 0000 0001 = Class: IN (0x0001)
                1... .... .... .... = Cache flush: True
                Time to live: 1 hour, 15 minutes
                Data length: 4
                Addr: 192.168.178.25 (192.168.178.25)

    Best regards,

    Martin

  • Peter,

    Can you post code showing how you get the malformed packets?

    Thanks,

    Aaron

  • Aaron L said:

    Can you post code showing how you get the malformed packets?

    Sure:

    {
      int i;
      int rc;

      for (i = 0; i < 4; ++i) {
        rc = mdnsAdvertiser(i != 2, "CC3000", strlen("CC3000"));
        cprintf("Result %d\n", rc);
        __delay_cycles(5 * 8000000UL); // Forced 5 second delay at 8MHz
      }
      return 0;
    }

    The console output is:

    > test
    Result 189
    Result 189
    Result 0
    Result 199

    The wireshark capture looks like:

    Peter

  • Hi Peter,

    can you please attach the Wireshark trace itself, or at least the single packet or packet in hex?

    Best regards,

    Martin

  • Sure.  The session is encrypted and was captured at the 802.11 level, so it may be you won't be able to decode this, though.  I don't know if there's enough info in the EAPOL exchange without also knowing the PSK.  The first three packets are from a previous session.

    This is another session, I'd already thrown away the previous one.

    Peter

  • Or maybe not.  TI doesn't like .capture as a suffix, and seems to have thrown out the tar file I wrapped it in.  Here it is in detailed XML format.

    If it doesn't show up again, the answer is no I can't post it.

    Did you try it and fail to reproduce the results?

    7077.mdns-pdml.zip