import { ResponseCodes , ResponseTags } from '../enums' ; export const convertLittleEndianNumber = ( data ) : number => { let value = 0 ; for ( let i = 0 ; i < data . length ; i ++ ) { value += data [ i ] << ( 8 * i ) ; } return value ; } ; export const getResponseCode = ( response ) : ResponseCodes => { const data = response . slice ( 8 , 11 ) ; return convertLittleEndianNumber ( data ) ; } ; export const getResponseTag = ( response ) : ResponseTags => { return response [ 4 ] ; } ;