pub fn serialize<S>(
    params: &BTreeMap<(SerialHardware, u8), SerialParameters>,
    ser: S
) -> Result<S::Ok, S::Error>where
    S: Serializer,