Log off can be done by passing the following buffer to the dev specific functions:
unsigned char buf[3];
int len = 3;
buf[0] = 9; // Constant that means Shortcode
buf[1] = 47; // Constant that means Log off
buf[2] = 0; // Don't forget the null terminator