#envSim Details - Receives all pipe write FD from command line args # Thread A - name_attach /dev/local/environment - while loop: receiving actuator pulses and updating the stored state of that actuator in the process - data receive in the form TEMP;UP or TEMP;DOWN or TEMP;OFF. TEMP and associated states UP DOWN OFF are defined in constants.h - accessing the state of an actuator should be mutexed # Thread B - Get mutex and check the actuator state - if actuator OFF (OFF is defined in constants.h) then modify temp as `temp+=randomNum(-1, 1)` and push to correct pipe - if actuator UP (UP is defined in constants.h) then modify temp as `temp+=randomNum(0.5, 1)` - if actuator DOWN (DOWN is defined in constants.h) then modify temp as `temp+=randomNum(-0.5, -1)`
#envSim Details
Thread A
Thread B
temp+=randomNum(-1, 1)and push to correct pipetemp+=randomNum(0.5, 1)temp+=randomNum(-0.5, -1)