Other Parts Discussed in Thread: CC3135
Hi all,
I am using a CC3135 module to connect to a WiFi network. My devices are advertising on the network using a service name composed by a device-specific ID and a common service name:
int simplelink_configure_mdns(int mode, char *name, char* txt, int port) { static char mds_service[64]; int retval; retval = simplelink_start_stop_mdns(1); // Start mdns service <-- Registration of a new service should be performed only if the mDNS service is enabled ASSERT_ON_ERROR(retval, NETAPP_ERROR); // unregister mdns services retval = sl_NetAppMDNSUnRegisterService(0, 0, 0); ASSERT_ON_ERROR(retval, NETAPP_ERROR); if (!mode) { return retval; } //name = device ID //MDNS_STRING = "_smartcam._tcp.local" sprintf(mds_service, "%s.%s", name, MDNS_STRING); /* Stop continuous query */ retval = sl_NetAppSet(SL_NETAPP_MDNS_ID, SL_NETAPP_MDNS_CONT_QUERY_OPT,0 , 0); /* Register mDNS services */ // Advertise (Mdns host) broadcasts its own IP address, port number and message to 224.0.0.251 + 5353 uint32_t opt = /*SL_NETAPP_MDNS_OPTIONS_IS_UNIQUE_BIT |*/ SL_NETAPP_MDNS_IPV4_ONLY_SERVICE | SL_NETAPP_MDNS_OPTIONS_IS_NOT_PERSISTENT; retval = sl_NetAppMDNSRegisterService((const signed char*)mds_service, strlen(mds_service), (const signed char*)txt, strlen(txt), port, TTL_VALUE, opt); ASSERT_ON_ERROR(retval, NETAPP_ERROR); LOG_SERIAL_INFO("[mDNS advertise] : service name %s registered successfully", mds_service); /* The below parameters are used to configure the advertise times and interval For example: If: Period is set to T Repetitions are set to P Telescopic factor is K=2 The transmission shall be: advertise P times wait T advertise P times wait 4 * T advertise P time wait 16 * T ... (till max time reached / configuration changed / query issued) */ SlNetAppServiceAdvertiseTimingParameters_t Timing; Timing.t = 100; // 1 seconds Default is 100 ticks for 1 second Timing.p = 2; // 2 repetitions Timing.k = 2; // Telescopic factor 1 Timing.RetransInterval = 500; Timing.Maxinterval = 1000; Timing.max_time = 0xFF; // in seconds FOREVER retval = sl_NetAppSet(SL_NETAPP_MDNS_ID, SL_NETAPP_MDNS_TIMING_PARAMS_OPT, sizeof(Timing), (const unsigned char*)&Timing); if (retval < 0) { LOG_SERIAL_ERROR("[mDNS advertise] : mDNS set timing params %d", retval); } return retval; }
When I have only one device advertising, I see a 'Standard query response' after a 'Standard query' from the software looking for devices:
When I have 2 devices instead, I see also the two devices sending queries as reply to a software query (see the highlighted message)
It seems that the device is sending a query to the PC instead of a query response.
Can someone explain me why? Can I avoid it in some way? It seems that this behaviour is slowing down the devices detection by the PC.
Thank you
regards
Arianna