A communications library for an underwater modem