digraph rfcomm_channel {
	// rankdir=LR;
	size="8,5"
    // orientation=landscape;
    // rotate = 90;

    CLOSED  [shape=doublecircle];
	OPEN  [shape=doublecircle];

    // DISC #x or DM

    // rfcomm_create_channel_internal
    CLOSED->W4_MULTIPLEXER [label = "create channel [multiplexer==closed]"];
    CLOSED->SEND_UIH_PN [label = "create channel [multiplexer==open]"];
    W4_MULTIPLEXER->SEND_UIH_PN [label = "multiplexere opened"];
    SEND_UIH_PN->W4_PN_RSP [label="SEND PN CMD"];
    W4_PN_RSP->SEND_SABM_W4_UA [label="RECV PN RSP"];
    SEND_SABM_W4_UA->W4_UA[label="SEND SABM"];
         
    // rfcomm_multiplexer_l2cap_packet_handler
    
    // rfcomm_packet_handler
    CLOSED->INCOMING_SETUP  [label = "RECV SABM#x / inform client"];
    CLOSED->INCOMING_SETUP  [label = "RECV PN CMD / inform client"];
    CLOSED->INCOMING_SETUP  [label = "RECV RPN CMD / inform client"];
         
    // rfcomm_decline_connection_internal
    INCOMING_SETUP->SEND_DM [label = "decline connection"];
    
    // rfcomm_disconnect_internal
    OPEN->SEND_DISC [label="disconnect"];
    
    // rfcomm_run
    SEND_DM->CLOSED [label="SEND DM_PF"];
    SEND_DISC->CLOSED [label="SEND DISC"];

    // rfcomm_accept_connection_internal
    INCOMING_SETUP->INCOMING_SETUP [label="accept connection/confirm"];
    INCOMING_SETUP->DLC_SETUP [label="-[CAN SEND] / SEND UA"];
    W4_UA->DLC_SETUP[label="RECV UA"];
    DLC_SETUP->OPEN [label="exchanged MSC & credits > 0"];
}