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

  • Quick Moderate Expert photo and video moderation & face recognition. Ensure content safety & compliance. Explore our services today.

    Ensure a safe online environment with our advanced solutions for detecting sensitive content. Our effective moderation tools protect users and communities by identifying and managing inappropriate materials seamlessly. Discover how we enhance online safety and maintain brand integrity today!

  • This is a great question, Joseph — it's always good to revisit fundamentals! Direct assignment between structures like m_preferred_conn_params = *p_init->p_conn_params; is valid in C when both operands are of the same struct type, as in the case of ble_gap_conn_params_t. It performs a shallow copy, meaning all the member values are copied field by field — no need to manually assign each one. This kind of clean struct handling in embedded C is one of the reasons why BLE stacks like Nordic's are relatively intuitive once you get familiar.

    On a related note, when diving into embedded development, juggling low-level concepts, timing constraints, and hardware interactions can be overwhelming — especially for students. That’s why resources offering assignment help or even the option to pay someone to do assignments in embedded systems can be lifesavers when deadlines are tight or concepts aren’t clicking immediately. Just make sure to balance learning with any assistance you get!

  • When you’re balancing multiple assignments and personal commitments, coding in Python can feel like an uphill task. That’s why I chose an Online Assignment Help service that provides expert Python Assignment Help. Their team consists of knowledgeable developers who not only complete the assignments but also provide insightful explanations. From recursion to file handling, every topic is covered thoroughly. I loved how they maintained quality while still delivering before the deadline. Their support system is also excellent, offering timely responses and revisions if needed. Students who need a push in programming should definitely explore Python Assignment Help via professional Online Assignment Help providers—they can make all the difference in your academic life.

  • I’ve used this Assignment Writing Service a few times now and their Assignment Help UK always delivers. My most recent experience was with a psychology assignment, and the writer did an outstanding job. The analysis was deep, the examples were relevant, and the final document was free from any grammatical issues. I got a high grade, and it gave me the confidence I needed for my future assignments. I appreciate that they offer edits if needed, though I’ve rarely had to ask for one. For any student looking for reliable Help With Assignment, this service is worth every penny.

  • Need expert Accounting Assignment Help in the UK? Our qualified professionals assist with financial accounting, management accounting, auditing, taxation, and corporate finance assignments. We deliver plagiarism-free, well-researched solutions tailored to UK standards (GAAP/IFRS). With timely delivery and 24/7 support, we ensure top grades. Get reliable help today!

Related