Advertisement
171
SWRU455A – February 2017 – Revised March 2017
Copyright © 2017, Texas Instruments Incorporated
mDNS
const signed char
AddService[40] = "printer._ipp._tcp.local";
Options = SL_NETAPP_MDNS_OPTIONS_IS_NOT_PERSISTENT;
Status = sl_NetAppMDNSUnRegisterService(AddService,strlen(AddService),Options);
if
( Status )
{
/* Error */
}
10.6.3 Advertisement Settings
10.6.3.1 Timing
This option allows the control and reconfiguration of the timing parameters for all services advertisements.
The API includes a unique structure for this specific configuration, with the following parameters:
•
T – Number of ticks for the initial period. Default is 100 ticks for 1 second.
•
P – Number of repetitions. Default value is 1.
•
K – Increasing interval factor. Default value is 2.
•
Retransmission interval – Number of ticks to wait before sending out repeated announcement
message. Default value is 0.
•
Max interval – Period interval. Number of ticks between two announcement periods. Default value is
0xFFFFFFFF.
•
Max time – Maximum time of an announcing period, default value is 3 seconds.
For example, if period is set to T, repetitions are set to P, – increasing interval 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 ... (until max time reached / configuration changed /query issued).
Example:
_i16 Status;
SlNetAppServiceAdvertiseTimingParameters_t Timing;
Timing.t = 200;
/* 2 seconds */
Timing.p = 2;
/* 2 repetitions */
Timing.k = 2;
/* Telescopic factor 2 */
Timing.RetransInterval = 0;
Timing.Maxinterval = 0xFFFFFFFF;
Timing.max_time = 5;
Status = sl_NetAppSet(SL_NETAPP_MDNS_ID, SL_NETAPP_MDNS_TIMING_PARAMS_OPT,
sizeof
(Timing),&Timing);
if
( Status )
{
/* Error */
}
10.6.3.2 Update Text
The SimpleLink device offers the ability to update the text field for registered services. The update can be
performed for the text field only. The API must be applied with the previous registered service name. If the
service was originally created as persistent, it is optional to update the text field as persistent or as
nonpersistent:
•
Updating the text with the nonpersistent flag causes the service to hold the updated text until the
device resets, which then returns to the original text.
•
Updating the text as persistent causes the service to store the updated text, even after a device reset.
If the service was originally created as nonpersistent, updating the text should apply with the nonpersistent
flag accordingly, otherwise an error returns.
Example:
_i16 Status;