Skip to content

Latest commit

 

History

18 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Common Wireless Infrastructure

Shared MATLAB functions used across multiple wireless communications simulation projects. This repository is designed to be included as a git submodule in each project repository.

Included Functions

Database I/O

Function Purpose
mysql_login.m Connect to MySQL using this machine's locally-configured credentials (auto-provisions the database if it doesn't exist)
get_mysql_credentials.m First-run interactive setup - detects a local MySQL server and caches credentials in a git-ignored mysql_local.json
mysql_load.m Fetch rows from MySQL by param_hash
mysql_write.m Insert/update with weighted-averaged metric merging (optional mutex)
mysql_check.m Read flag from system_flags table
mysql_set.m / mysql_unset.m Set/clear inter-process flags
connectWithRetry.m Retry DB connection up to 50 times with 30s wait
addMysqlJarOnce.m Add MySQL JDBC JAR to Java classpath once
local_write.m Excel read/write fallback with weighted-averaging

Hashing

Function Purpose
jsonencode_sorted.m Deterministic JSON encoding + SHA-256 hash (field names sorted alphabetically)
DataHash.m Third-party SHA-256/MD5 utility (Jan Simon)

Visualization

Function Purpose
gen_table.m Display results as a MATLAB table in the console
updateProgressBar.m Braille-character progress bar with system parameter display

CLI Utilities

Function Purpose
profile_select.m Interactive console menu for profile selection
figure_settings.m Interactive console prompt for figure rendering settings

MySQL Setup (First Run)

No credentials are stored in this repository. The first time a project enables MySQL storage, mysql_login.m walks you through a one-time setup:

  1. It checks whether a MySQL server is running on localhost:3306.
  2. If found, it asks for that server's password (assumes the root user).
  3. If not found, it asks for a remote host to connect to instead - or you can just press Enter to skip and use local Excel storage only.
  4. Once a connection succeeds, the credentials are cached in mysql_local.json at the consuming project's root (already covered by .gitignore - never committed) and reused silently on every run after that.
  5. The target database schema (e.g. comm_database) is created automatically if it doesn't already exist.

To reconfigure (e.g. a new password), delete mysql_local.json and re-run.

Usage as a Submodule

This repository is not meant to be used standalone. Each project that depends on these functions should add this repo as a git submodule:

git clone --recurse-submodules https://github.com/JRW-lab/Common-Wireless-Infrastructure.git

Or add to an existing project:

cd /path/to/project
git submodule add https://github.com/JRW-lab/Common-Wireless-Infrastructure.git Common-Wireless-Infrastructure

Then in MATLAB, add the submodule to your path:

addpath('Common-Wireless-Infrastructure/Meta Functions');

Versioning

Each project repo pins a specific commit of this shared infrastructure via .gitmodules. To update all projects to the latest shared code:

cd Common-Wireless-Infrastructure
git pull origin main
cd ..
git add Common-Wireless-Infrastructure
git commit -m "Update shared infrastructure to latest"

Requirements

  • MATLAB R2024b or later
  • Database Toolbox (for MySQL functions)
  • Parallel Computing Toolbox (for parfor progress reporting)
  • mysql-connector-j-8.4.0.jar (JDBC driver, included in project repos)

Contact

For questions, contact jrwimer@uark.edu or visit my website.

About

Shared MATLAB functions for wireless communications simulation projects

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages