Initial msp library implementation with connection state tracking