@@ -378,14 +378,64 @@ class NetworkInterface: public DNS {
378
378
*/
379
379
virtual nsapi_error_t set_blocking (bool blocking);
380
380
381
- /* * Get suggested data transmission jitter from underlying network interface.
382
- *
383
- * @param data_amount Amount of data to be sent
384
- * @param jitter Address to location where suggested jitter value is written
385
- * @return NSAPI_ERROR_OK on success
386
- * @return NSAPI_ERROR_UNSUPPORTED, NSAPI_ERROR_NO_CONNECTION
387
- */
388
- virtual nsapi_error_t get_interface_property (unsigned int data_amount, unsigned int *jitter);
381
+ /* * Get network interface timing properties.
382
+ *
383
+ * Network interfaces have different characteristics. Some wireless networks are
384
+ * established slowly and may have a high latency while some wired networks are
385
+ * ready almost instantly after power on.
386
+ *
387
+ * Application can use network timing properties to adapt to the varying network
388
+ * interfaces. Properties include:
389
+ * * initial delay, a estimated wait time that application should wait after startup before sending data to the network.
390
+ * * round-trip time, a estimated time between sending a signal and receiving the response.
391
+ *
392
+ * @param data_amount Amount of data to be sent in kilobytes.
393
+ * @param initial_delay_min Address to minimum delay value (ms), must be non-null.
394
+ * @param initial_delay_max Address to maximum delay value (ms), must be non-null.
395
+ * @param initial_delay_rand Address to randomized delay value (ms), must be non-null.
396
+ * @param expected_rtt Address to expected round-trip time value (ms), must be non-null.
397
+ * @return NSAPI_ERROR_OK on success.
398
+ * @return NSAPI_ERROR_UNSUPPORTED if API is not implemented to interface.
399
+ * @return NSAPI_ERROR_NO_CONNECTION if network is not connected.
400
+ * @return NSAPI_ERROR_PARAMETER. if input parameters are not valid.
401
+ */
402
+ virtual nsapi_error_t get_interface_timing_property (unsigned int data_amount,
403
+ unsigned int *initial_delay_min,
404
+ unsigned int *initial_delay_max,
405
+ unsigned int *initial_delay_rand,
406
+ unsigned int *expected_rtt);
407
+
408
+ /* * Get initial delay for the network interface
409
+ *
410
+ * Initial delay can be used to optimize network performance. Some wireless networks
411
+ * use a lot of network bandwidth to find and extend the network during startup.
412
+ * Having an application sending data aggressively during the startup can result to
413
+ * network congestion that will drop network performance even more.
414
+ * Initial delay is a randomized value based on the selected interface properties.
415
+ *
416
+ * @param data_amount Amount of data in kilobytes that application is going to send.
417
+ * @param initial_delay Address to location where initial_delay is written in milliseconds.
418
+ * @return NSAPI_ERROR_OK on success.
419
+ * @return NSAPI_ERROR_UNSUPPORTED if API is not implemented to interface.
420
+ * @return NSAPI_ERROR_NO_CONNECTION if network is not connected.
421
+ * @return NSAPI_ERROR_PARAMETER. if input parameters are not valid.
422
+ */
423
+ virtual nsapi_error_t get_interface_initial_delay (unsigned int data_amount,
424
+ unsigned int *initial_delay);
425
+
426
+ /* * Get network interface expected round-trip time (RTT)
427
+ *
428
+ * Application can use expected RTT to adjust possible retry intervals.
429
+ * Wired networks may have RTT value less than a seconds while some wireless
430
+ * networks could have a RTT up to several minutes.
431
+ *
432
+ * @param expected_rtt Address to location where expected RTT is written (ms).
433
+ * @return NSAPI_ERROR_OK on success.
434
+ * @return NSAPI_ERROR_UNSUPPORTED if API is not implemented to interface.
435
+ * @return NSAPI_ERROR_NO_CONNECTION if network is not connected.
436
+ * @return NSAPI_ERROR_PARAMETER. if input parameters are not valid.
437
+ */
438
+ virtual nsapi_error_t get_interface_rtt (unsigned int *expected_rtt);
389
439
390
440
/* * Return pointer to an EthInterface.
391
441
* @return Pointer to requested interface type or NULL if this class doesn't implement the interface.
0 commit comments