This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

direct assignment to ble_gap_conn_params_t variable

Hello Nordic support team,

Forgive me if I am asking a stupid question.

In the source file ble_conn_params.c, there is a function called ble_conn_params_init() and I found this direct assignment:

    m_preferred_conn_params = *p_init->p_conn_params;

but m_preferred_conn_params is a variable of ble_gap_conn_params_t which is a structure:

typedef struct {

uint16_t min_conn_interval;
/**< Minimum Connection Interval in 1.25 ms units, see @ref BLE_GAP_CP_LIMITS.*/

uint16_t max_conn_interval;
/**< Maximum Connection Interval in 1.25 ms units, see @ref BLE_GAP_CP_LIMITS.*/

uint16_t slave_latency;
/**< Slave Latency in number of connection events, see @ref BLE_GAP_CP_LIMITS.*/

uint16_t conn_sup_timeout;
/**< Connection Supervision Timeout in 10 ms units, see @ref BLE_GAP_CP_LIMITS.*/

} ble_gap_conn_params_t;

So why this direct assignment is possible?

Best Regards, Joseph

Parents
  • Well, p_conn_params is a pointer to a ble_gap_conn_params_t, so if you de-reference the pointer as the code appears to do you can assign a struct to a struct.

  • Thank you John for your reply.

    So it is taken care by the compiler and it will be replaced by a memcpy(dest,src,size) statement, right?

  • Worry about completing your Operation Management assignments. Relax! I provide online  Operation Management Assignment Writing Services to university students. I have more than 8 years of experience in providing assignment services.I have so far helped 1000+ students to achieve good grades in their studies. Submit your ideas and get plagiarised free assignment in hours with free Turnitin reports.

  • Discover premium cleaning services in your area for unmatched cleanliness and hygiene. Our team of professionals delivers customized cleaning solutions designed to meet your specific requirements, providing a pristine environment swiftly. We pride ourselves on meticulous attention to detail and unwavering professionalism, ensuring complete satisfaction with each service rendered.

  • It was great to visit your website and all your posts are wonderful, keep posting such good posts. And keep sharing knowledge with us. Also visit- Amenify Modular Furniture designer services

Reply Children
No Data