Rust: Programming language for safety and speed

Introduction Rust is a non-garbage collected, compiled systems programming language with strong typing. It began as a personal project by a Mozilla research employee in 2006, and later, Mozilla started sponsoring the project in 2009. Eventually, Mozilla adopted Rust for Firefox and rewrote the core in Rust in 2017. Rust is an advanced language with numerous features that developers appreciate. Positioned as a compelling alternative to C/C++, Rust offers robust capabilities for system-level programming. ...

February 7, 2024

Python Dependency Management: pip and poetry

Install package using pip python3 -m pip install iotcore Show package details using pip python3 -m pip show iotcore Uninstall package using pip python3 -m pip uninstall iotcore List installed packages using pip python3 -m pip list Upgrade a package using pip python3 -m pip install --upgrade iotcore # or python3 -m pip install -U iotcore New python project using poetry poetry new poeetry_demo Install new package using poetry poetry add arrow Show installed packages using poetry ...

November 27, 2023

Refresh C Programming

Convert void data-type (byte array) to uint8_t type static uint8_t notify_func(const void *data) { uint8_t value = ((uint8_t *)data)[7]; return value; } Structure data-type as function arguments static uint8_t notify_func(struct bt_gatt_subscribe_params *params) { printk("value_handle : %d", params->value_handle) } Declare enums as types typedef enum { STRING, NUMBERS, COMPLEX, DATATYPE_COUNT, INVALID_SENSOR } sensor_datatype_t; String initialisation to char pointer const char *p_mac_addr = "0C:8C:DC:41:E1:EF"; static void print_mac_addr(void) { printk("p_mac_addr : %s\n", p_mac_addr) } String as function return values char* get_sensor_mac_addr(void){ return p_mac_addr; } Parse unsigned int from byte array pointer ...

November 11, 2023