40h protocol

added 40h protocol support
fixed 256 detection bug